You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/03.nano/boards/nano-r4/tutorials/01.user-manual/content.md
+148Lines changed: 148 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2290,6 +2290,154 @@ When working with HID on the Nano R4, there are several key points to keep in mi
2290
2290
- The Nano R4 can function as both a keyboard and mouse simultaneously, allowing for complex automation sequences that combine typing, shortcuts and mouse control.
2291
2291
- Remember that different operating systems may have slightly different keyboard layouts and shortcuts, so test your HID projects on your target platform to ensure compatibility.
2292
2292
2293
+
## Qwiic Connector
2294
+
2295
+
The Nano R4 board features an onboard Qwiic connector that provides a simple, tool-free solution for connecting I²C devices. The Qwiic ecosystem, developed by SparkFun Electronics, has become an industry standard for rapid prototyping with I²C devices, allowing you to connect sensors, displays, and other peripherals without soldering or complex wiring. This makes it perfect for quickly building sensor networks, adding displays, or expanding your project's capabilities with minimal effort.
2296
+
2297
+

2298
+
2299
+
The Qwiic connector enhances the Nano R4's versatility by providing a dedicated interface for the extensive ecosystem of +3.3 VDC I²C modules. While the Nano R4's native +5 VDC operation ensures compatibility with classic Arduino shields and components, the Qwiic interface adds seamless integration with modern sensors and modules. The board includes built-in level translation between the +5 VDC microcontroller and the +3.3 VDC Qwiic bus, giving you the best of both worlds: full compatibility with traditional Arduino hardware on the main pins, plus instant access to the latest Qwiic-compatible devices.
2300
+
2301
+
### Qwiic Specifications
2302
+
2303
+
The Nano R4's Qwiic connector offers the following specifications:
| Pin Order |`GND`, `VCC`, `SDA`, `SCL`| Standard Qwiic pinout |
2312
+
2313
+
The Qwiic connector is a small 4-pin connector with a 1.00 mm pitch. The mechanical details of the connector can be found in the connector's [datasheet](https://www.jst-mfg.com/product/pdf/eng/eSH.pdf).
2314
+
2315
+
The pin layout of the Qwiic connector is the following:
2316
+
2317
+
-`GND`: Ground
2318
+
-`VCC`: +3.3 VDC power supply
2319
+
-`SDA`: I²C data line
2320
+
-`SCL`: I²C clock line
2321
+
2322
+
The `VCC` pin provides a stable +3.3 VDC output from the onboard regulator when the board is powered. The manufacturer part number of the Qwiic connector is [SM04B-SRSS-TB](https://www.jst-mfg.com/product/pdf/eng/eSH.pdf), and its matching cable assemblies use the [SHR-04V-S-B](https://www.jst-mfg.com/product/pdf/eng/eSH.pdf) receptacle.
2323
+
2324
+
### Understanding the Dual I²C Architecture
2325
+
2326
+
The Nano R4 implements a dual I²C bus architecture that separates +5 VDC and +3.3 VDC devices:
***__Important note__: The Qwiic connector uses `Wire1` object, not the standard `Wire` object. This is different from boards with a single I²C bus. Always use `Wire1.begin()` and related `Wire1` functions when communicating with Qwiic devices.***
2334
+
2335
+
### Connecting Qwiic Devices
2336
+
2337
+
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.
2338
+
2339
+
The Qwiic system's key advantages include:
2340
+
2341
+
-**Plug-and-play connectivity**: No breadboards, jumper wires, or soldering required
Serial.println("- Arduino Nano R4 - Modulino Movement Example started...");
2374
+
2375
+
// Initialize Wire1 for Qwiic connector
2376
+
Wire1.begin();
2377
+
2378
+
// Initialize Modulino system
2379
+
Modulino.begin();
2380
+
2381
+
// 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
+
}
2387
+
2388
+
Serial.println("- Modulino Movement connected successfully!");
2389
+
Serial.println("- Reading motion data...\n");
2390
+
}
2391
+
2392
+
void loop() {
2393
+
// Variables for sensor data
2394
+
float ax, ay, az; // Acceleration in g
2395
+
float gx, gy, gz; // Gyroscope in degrees/second
2396
+
2397
+
// Read sensor data
2398
+
movement.getAcceleration(ax, ay, az);
2399
+
movement.getGyroscope(gx, gy, gz);
2400
+
2401
+
// Display acceleration
2402
+
Serial.print("- Accel (g): X=");
2403
+
Serial.print(ax, 2);
2404
+
Serial.print(" Y=");
2405
+
Serial.print(ay, 2);
2406
+
Serial.print(" Z=");
2407
+
Serial.print(az, 2);
2408
+
2409
+
// 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
+
}
2422
+
2423
+
Serial.println();
2424
+
2425
+
// Update at 10Hz
2426
+
delay(100);
2427
+
}
2428
+
```
2429
+
2430
+
***To test this example, you need an [Arduino Modulino Movement](https://store.arduino.cc/collections/modulino/products/modulino-movement) connected to the Nano R4's Qwiic connector via a Qwiic cable. Install the Modulino library from the Arduino IDE Library Manager (Tools > Manage Libraries > Search "Modulino").***
2431
+
2432
+
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.
2433
+
2434
+
This example demonstrates the key aspects of using Qwiic devices with the Nano R4:
2435
+
2436
+
- Using `Wire1.begin()` instead of `Wire.begin()` for the Qwiic connector
2437
+
- Direct plug-and-play connection without additional wiring
2438
+
- Automatic +3.3 VDC power and level translation
2439
+
- Access to Arduino's ecosystem of Modulino sensors
2440
+
2293
2441
## Bootloader
2294
2442
2295
2443
The Nano R4 board features a built-in bootloader that enables sketch uploading directly from the Arduino IDE without requiring external programming hardware. The bootloader is a small program stored in a protected area of the RA4M1 microcontroller's flash memory that runs each time the board powers on or resets. It manages the critical communication between your computer and the board during sketch uploads, making the development process simple and accessible.
0 commit comments