Skip to content

Commit 022f72d

Browse files
committed
Content update (user manual)
1 parent 18dd8ca commit 022f72d

File tree

7 files changed

+95
-27
lines changed

7 files changed

+95
-27
lines changed
858 KB
Loading
831 KB
Loading
456 KB
Loading
831 KB
Loading
419 KB
Loading
421 KB
Loading

content/hardware/03.nano/boards/nano-33-ble-sense-rev2/tutorials/01.user-manual/content.md

Lines changed: 95 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -233,94 +233,162 @@ Congratulations! You have successfully completed your first program on the Nano
233233

234234
## LEDs
235235

236-
This user manual section covers the Nano 33 BLE Sense Rev2 built-in LEDs, showing their main hardware and software characteristics.
236+
This user manual section covers the Nano 33 BLE Sense Rev2 board built-in LEDs, showing their main hardware and software characteristics.
237237

238238
### RGB LED
239239

240-
The Nano 33 BLE Sense Rev2 features a built-in RGB LED that can be used as a visual feedback indicator for the user.
240+
The Nano 33 BLE Sense Rev2 board features a built-in RGB LED that can be used as a visual feedback indicator for the user.
241+
242+
![Built-in RGB LED of the Nano 33 BLE Sense Rev2 board](assets/rgb.png)
241243

242244
The built-in RGB LED can be accessed through the following macro definitions:
243245

244-
| **Built-in LED** | **Macro Definition** |
245-
| :--------------: | :------------------: |
246-
| Red LED | `LEDR` |
247-
| Green LED | `LEDG` |
248-
| Blue LED | `LEDB` |
246+
| **Built-in LED** | **Macro Definition** | **Microcontroller Pin** |
247+
| :--------------: | :------------------: | :---------------------: |
248+
| Red LED | `LEDR` | `P0.24` |
249+
| Green LED | `LEDG` | `P0.16` |
250+
| Blue LED | `LEDB` | `P0.06` |
251+
252+
***The built-in RGB LED on the Nano 33 BLE Sense Rev2 uses __inverted logic__. This means that a voltage level of `LOW` on each of their pins will turn the specific color of the LED on, and a voltage level of `HIGH` will turn them off.***
249253

250-
The following example sketch each of the RGB LED colors at an interval of 500 ms:
254+
The following example sketch controls each of the RGB LED colors at an interval of 500 ms:
251255

252256
```arduino
253257
/**
254-
RGB LED Example for the Arduino Nano 33 BLE Sense BLE Sense Rev2
258+
RGB LED Example for the Arduino Nano 33 BLE Sense Rev2 Board
255259
Name: nano_33_ble_sense_rev2_rgb_led.ino
256260
Purpose: This sketch demonstrates how to control the built-in
257261
RGB LED of the Arduino Nano 33 BLE Sense Rev2 board.
258262
263+
@author Arduino Product Experience Team
264+
@version 1.0 01/06/25
259265
*/
260266
261267
void setup() {
262-
// Initialize serial communication and wait up to 2.5 seconds for a connection
268+
// Initialize serial communication and wait up to 2.5 seconds for connection
263269
Serial.begin(115200);
264-
for (auto startNow = millis() + 2500; !Serial && millis() < startNow; delay(500));
270+
unsigned long startTime = millis();
271+
while (!Serial && millis() - startTime < 2500) {
272+
delay(100);
273+
}
265274
266275
// Initialize LEDR, LEDG and LEDB as outputs
267276
pinMode(LEDR, OUTPUT);
268277
pinMode(LEDG, OUTPUT);
269278
pinMode(LEDB, OUTPUT);
270279
271-
// Turn off all LEDs initially
272-
digitalWrite(LEDR, LOW);
273-
digitalWrite(LEDG, LOW);
274-
digitalWrite(LEDB, LOW);
280+
// Turn off all LEDs initially (HIGH = OFF for inverted logic)
281+
digitalWrite(LEDR, HIGH);
282+
digitalWrite(LEDG, HIGH);
283+
digitalWrite(LEDB, HIGH);
275284
276285
Serial.println("- Arduino Nano 33 BLE Sense Rev2 - RGB LED Example started...");
277286
}
278287
279288
void loop() {
280289
// Turn on the built-in red LED and turn off the rest
281-
digitalWrite(LEDR, HIGH);
282-
digitalWrite(LEDG, LOW);
283-
digitalWrite(LEDB, LOW);
290+
digitalWrite(LEDR, LOW); // ON
291+
digitalWrite(LEDG, HIGH); // OFF
292+
digitalWrite(LEDB, HIGH); // OFF
284293
Serial.println("- Red LED on!");
285294
delay(500);
286295
287296
// Turn on the built-in green LED and turn off the rest
288-
digitalWrite(LEDR, LOW);
289-
digitalWrite(LEDG, HIGH);
290-
digitalWrite(LEDB, LOW);
297+
digitalWrite(LEDR, HIGH); // OFF
298+
digitalWrite(LEDG, LOW); // ON
299+
digitalWrite(LEDB, HIGH); // OFF
291300
Serial.println("- Green LED on!");
292301
delay(500);
293302
294303
// Turn on the built-in blue LED and turn off the rest
295-
digitalWrite(LEDR, LOW);
296-
digitalWrite(LEDG, LOW);
297-
digitalWrite(LEDB, HIGH);
304+
digitalWrite(LEDR, HIGH); // OFF
305+
digitalWrite(LEDG, HIGH); // OFF
306+
digitalWrite(LEDB, LOW); // ON
298307
Serial.println("- Blue LED on!");
299308
delay(500);
300309
301310
// Turn off all LEDs
302-
digitalWrite(LEDR, LOW);
303-
digitalWrite(LEDG, LOW);
304-
digitalWrite(LEDB, LOW);
311+
digitalWrite(LEDR, HIGH); // OFF
312+
digitalWrite(LEDG, HIGH); // OFF
313+
digitalWrite(LEDB, HIGH); // OFF
305314
Serial.println("- All LEDs off!");
306315
delay(500);
307316
}
308317
```
309318

310319
You should now see the built-in RGB LED cycling through red, green, and blue colors, followed by a brief moment with all LEDs off, repeating this pattern continuously.
311320

321+
![RGB LED blink sketch in the Nano 33 BLE Sense Rev2](assets/rgb.gif)
322+
312323
Additionally, you can open the Arduino IDE's Serial Monitor (Tools > Serial Monitor) to see the status messages that the example sketch sends each time the RGB LEDs state changes.
313324

325+
![Arduino IDE Serial Monitor output for the RGB LED example sketch](assets/serial-monitor-rgb-blink.png)
326+
314327
### Orange LED
315328

316329
The Nano 33 BLE Sense Rev2 also features a built-in orange user LED that can be used for basic status indications and debugging purposes.
317330

331+
![Built-in orange LED of the Nano 33 BLE Sense Rev2 board](assets/orange.png)
332+
318333
The built-in user LED can be accessed through the following macro definition:
319334

320335
| **Built-in LED** | **Macro Definition** | **Microcontroller Pin** |
321336
| :--------------: | :------------------: | :---------------------: |
322337
| Orange User LED | `LED_BUILTIN` | `P0.13` |
323338

339+
***Unlike the RGB LED, the built-in orange user LED on the Nano 33 BLE Sense Rev2 operates with standard logic levels. This means that a voltage level of `HIGH` will turn the LED on, and a voltage level of `LOW` will turn it off.***
340+
341+
The following example sketch demonstrates how to control the built-in user LED:
342+
343+
```arduino
344+
/**
345+
User LED Example for the Arduino Nano 33 BLE Sense Rev2 Board
346+
Name: nano_33_ble_sense_rev2_user_led.ino
347+
Purpose: This sketch demonstrates how to control the built-in
348+
orange user LED of the Arduino Nano 33 BLE Sense Rev2 board.
349+
350+
@author Arduino Product Experience Team
351+
@version 1.0 01/06/25
352+
*/
353+
354+
void setup() {
355+
// Initialize serial communication and wait up to 2.5 seconds for connection
356+
Serial.begin(115200);
357+
unsigned long startTime = millis();
358+
while (!Serial && millis() - startTime < 2500) {
359+
delay(100);
360+
}
361+
362+
// Configure LED_BUILTIN pin as output
363+
pinMode(LED_BUILTIN, OUTPUT);
364+
365+
// Turn off LED initially
366+
digitalWrite(LED_BUILTIN, LOW);
367+
368+
Serial.println("- Arduino Nano 33 BLE Sense Rev2 - User LED Example started...");
369+
}
370+
371+
void loop() {
372+
// Turn on the built-in user LED
373+
digitalWrite(LED_BUILTIN, HIGH);
374+
Serial.println("- User LED on!");
375+
delay(1000);
376+
377+
// Turn off the built-in user LED
378+
digitalWrite(LED_BUILTIN, LOW);
379+
Serial.println("- User LED off!");
380+
delay(1000);
381+
}
382+
```
383+
384+
You should now see the built-in orange user LED blinking on and off at 1-second intervals, repeating this pattern continuously.
385+
386+
![Orange LED blink sketch in the Nano 33 BLE Sense Rev2](assets/orange-led.gif)
387+
388+
Additionally, you can open the Arduino IDE's Serial Monitor (Tools > Serial Monitor) to see the status messages that the example sketch sends each time the user LED state changes
389+
390+
![Arduino IDE Serial Monitor output for the orange LED example sketch](assets/serial-monitor-orange-blink.png)
391+
324392
## Pins
325393

326394
This user manual section provides comprehensive information about the Nano 33 BLE Sense Rev2's pin capabilities and functionality. Understanding the board's pins capabilities and configurations is important for making the most of your projects with the Nano 33 BLE Sense Rev2 board.

0 commit comments

Comments
 (0)