Skip to content

Commit 347ef44

Browse files
committed
Content update (assets)
1 parent 0d699da commit 347ef44

File tree

3 files changed

+31
-28
lines changed

3 files changed

+31
-28
lines changed
599 KB
Loading
87.2 KB
Loading

content/hardware/03.nano/boards/nano-r4/tutorials/01.user-manual/content.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This user manual provides a comprehensive overview of the Nano R4 board, highlig
3131

3232
### Software Requirements
3333

34-
- [Arduino IDE 2.0+](https://www.arduino.cc/en/software) or [Arduino Web Editor](https://create.arduino.cc/editor)
34+
- [Arduino IDE](https://www.arduino.cc/en/software) or [Arduino Cloud Editor](https://create.arduino.cc/editor)
3535
- [Arduino UNO R4 Boards core](https://github.com/arduino/ArduinoCore-renesas)
3636

3737
***The Nano R4 is compatible with the complete Arduino ecosystem and can be programmed directly as a standalone device.***
@@ -2336,6 +2336,8 @@ The Nano R4 implements a dual I²C bus architecture that separates +5 VDC and +3
23362336

23372337
Connecting Qwiic devices to your Nano R4 board is straightforward. Simply get a standard Qwiic cable (available in various lengths) and plug one end into the Nano R4's Qwiic connector and the other into your Qwiic device. Most Qwiic devices have two connectors, allowing you to daisy-chain multiple devices without any soldering or breadboarding. The polarized connectors prevent incorrect connections, making the setup process foolproof.
23382338

2339+
![Nano R4 and Modulino Movement connected via Qwiic](assets/qwiic-connection.png)
2340+
23392341
The Qwiic system's key advantages include:
23402342

23412343
- **Plug-and-play connectivity**: No breadboards, jumper wires, or soldering required
@@ -2346,7 +2348,7 @@ The Qwiic system's key advantages include:
23462348

23472349
### Working with Qwiic Devices
23482350

2349-
The following example demonstrates how to use the Arduino Modulino Movement sensor via the Qwiic connector:
2351+
The following example demonstrates how to use the [Arduino Modulino Movement](https://store.arduino.cc/collections/modulino/products/modulino-movement) sensor via the Qwiic connector:
23502352

23512353
```arduino
23522354
/**
@@ -2365,6 +2367,10 @@ Modulino Movement sensor via the Qwiic connector.
23652367
// Create Modulino Movement object
23662368
ModulinoMovement movement;
23672369
2370+
// Variables for sensor data
2371+
float x, y, z;
2372+
float roll, pitch, yaw;
2373+
23682374
void setup() {
23692375
// Initialize serial communication and wait up to 2.5 seconds for a connection
23702376
Serial.begin(115200);
@@ -2379,46 +2385,41 @@ void setup() {
23792385
Modulino.begin();
23802386
23812387
// Initialize Movement sensor
2382-
if (!movement.begin()) {
2383-
Serial.println("- Error: Modulino Movement not found!");
2384-
Serial.println("- Please check Qwiic connection and reset");
2385-
while (1) delay(10);
2386-
}
2388+
movement.begin();
23872389
23882390
Serial.println("- Modulino Movement connected successfully!");
23892391
Serial.println("- Reading motion data...\n");
23902392
}
23912393
23922394
void loop() {
2393-
// Variables for sensor data
2394-
float ax, ay, az; // Acceleration in g
2395-
float gx, gy, gz; // Gyroscope in degrees/second
2395+
// Read new movement data from the sensor
2396+
movement.update();
2397+
2398+
// Get acceleration values
2399+
x = movement.getX();
2400+
y = movement.getY();
2401+
z = movement.getZ();
23962402
2397-
// Read sensor data
2398-
movement.getAcceleration(ax, ay, az);
2399-
movement.getGyroscope(gx, gy, gz);
2403+
// Get gyroscope values
2404+
roll = movement.getRoll();
2405+
pitch = movement.getPitch();
2406+
yaw = movement.getYaw();
24002407
24012408
// Display acceleration
24022409
Serial.print("- Accel (g): X=");
2403-
Serial.print(ax, 2);
2410+
Serial.print(x, 2);
24042411
Serial.print(" Y=");
2405-
Serial.print(ay, 2);
2412+
Serial.print(y, 2);
24062413
Serial.print(" Z=");
2407-
Serial.print(az, 2);
2414+
Serial.print(z, 2);
24082415
24092416
// Display gyroscope
2410-
Serial.print(" | Gyro (dps): X=");
2411-
Serial.print(gx, 1);
2412-
Serial.print(" Y=");
2413-
Serial.print(gy, 1);
2414-
Serial.print(" Z=");
2415-
Serial.print(gz, 1);
2416-
2417-
// Detect significant motion
2418-
float totalAccel = sqrt(ax*ax + ay*ay + az*az);
2419-
if (abs(totalAccel - 1.0) > 0.3) {
2420-
Serial.print(" <- Motion!");
2421-
}
2417+
Serial.print(" | Gyro (dps): Roll=");
2418+
Serial.print(roll, 1);
2419+
Serial.print(" Pitch=");
2420+
Serial.print(pitch, 1);
2421+
Serial.print(" Yaw=");
2422+
Serial.print(yaw, 1);
24222423
24232424
Serial.println();
24242425
@@ -2431,6 +2432,8 @@ void loop() {
24312432

24322433
You can open the Arduino IDE's Serial Monitor (Tools > Serial Monitor) to see the real-time acceleration and gyroscope data. Try moving or rotating the sensor to see the values change.
24332434

2435+
![Arduino IDE Serial Monitor output for the Modulino Movement sketch](assets/qwicc-modulino-serial-monitor.png)
2436+
24342437
This example demonstrates the key aspects of using Qwiic devices with the Nano R4:
24352438

24362439
- Using `Wire1.begin()` instead of `Wire.begin()` for the Qwiic connector

0 commit comments

Comments
 (0)