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
|**Analog Pins**| 8 |`A0` - `A7`| Analog input, Digital I/O, I²C |
304
+
|**Analog Pins**| 8 |`A0` - `A7`| Analog input, Digital I/O, I²C, DAC (`A0`)|
305
305
|**Power Pins**| 4 |`VIN`, `5V`, `3V3`, `GND`| Power supply and ground |
306
306
|**Special Pins**| 2 |`RESET`| System control |
307
307
@@ -381,6 +381,80 @@ digitalRead(pin);
381
381
```
382
382
383
383
The available pin modes are `OUTPUT` for digital output, `INPUT` for digital input with high impedance, and `INPUT_PULLUP` for digital input with internal pull-up resistor enabled. Digital output values can be `HIGH` (+3.3 VDC) or `LOW` (0 VDC), and digital input readings will return `HIGH` or `LOW` based on the voltage level detected on the pin.
384
+
385
+
### Analog Pins
386
+
387
+
The Nano 33 BLE Sense Rev2 features **8 analog input pins** (`A0` to `A7`) that can be read using the `analogRead()` function. These pins allow you to measure continuously varying voltages, making them perfect for reading sensors like potentiometers, light sensors, temperature sensors and other analog components and devices. The analog-to-digital converter (ADC) built into the nRF52840 microcontroller of the Nano 33 BLE Sense Rev2 board converts the analog voltage into a digital value that your sketch can process.
388
+
389
+
The Nano 33 BLE Sense Rev2 analog pins provide the following functionality:
You can read analog values using the `analogRead()` function:
415
+
416
+
```arduino
417
+
value = analogRead(pin);
418
+
```
419
+
The default reference voltage of these pins is +3.3 VDC, but this can be changed using the `analogReference()` function. You can use `analogReference(AR_VDD)` for the default reference of +3.3 VDC, `analogReference(AR_INTERNAL)` for the built-in reference of +0.6 VDC, `analogReference(AR_INTERNAL1V2)` for the built-in reference of +0.6 VDC with 2x gain, and `analogReference(AR_INTERNAL2V4)` for the built-in reference of +0.6 VDC with 4x gain.
420
+
421
+
The default resolution is set to 10-bit, but it can be updated to 12-bit resolution using the `analogReadResolution()` function in the `setup()` of your sketch. Available options are analogReadResolution(10) for default 10-bit and analogReadResolution(12) for 12-bit for maximum 14-bit resolution.
422
+
423
+
### PWM (Pulse Width Modulation)
424
+
425
+
The Nano 33 BLE Sense Rev2 board features multiple pins with PWM capability that can be used to generate analog-like output signals. PWM works by rapidly switching a digital output between `HIGH` and `LOW` states, where the ratio of `HIGH` time to the total period determines the effective analog voltage output.
426
+
427
+
The Nano 33 BLE Sense Rev2 board provides PWM functionality on the following pins:
|`D10`|`P1.02`| Channel 2A | Digital I/O, SPI CS |
440
+
|`D11`|`P1.01`| Channel 5A | Digital I/O, SPI MOSI |
441
+
|`D12`|`P1.08`| Channel 0B | Digital I/O |
442
+
|`D13`|`P0.13`| Channel 0B | Digital I/O |
443
+
444
+
***__Important note:__ . The onboard LEDs (`LEDR`, `LEDG`, `LEDB`, `LED_BUILTIN`) also support PWM for brightness control.***
445
+
446
+
You can use PWM pins as analog output pins with the `analogWrite()` function:
447
+
448
+
```arduino
449
+
analogWrite(pin, value);
450
+
```
451
+
452
+
By default, the resolution is 8-bit (0 to 255). You can use analogWriteResolution() to change this, supporting up to 12-bit (0 to 4095) resolution:
453
+
454
+
```arduino
455
+
analogWriteResolution(resolution);
456
+
```
457
+
384
458
## Support
385
459
386
460
If you encounter any issues or have questions while working with your Nano 33 BLE Sense Rev2 board, we provide various support resources to help you find answers and solutions.
0 commit comments