文章目录
- 1. Features
- 2. Pins Name
- 3. Functions
- 3.1 analogReadResolution()
- 3.2 millis()
- Ref.
1. Features
2. Pins Name
3. Functions
3.1 analogReadResolution()
analogReadResolution()
is an extension of the Analog API for the Zero, Due, MKR family, Nano 33 (BLE and IoT) and Portenta.
Sets the size (in bits) of the value returned by analogRead(). It defaults to 10 bits (returns values between 0-1023) for backward compatibility with AVR based boards.
The Zero, Due, MKR family and Nano 33 (BLE and IoT) boards have 12-bit ADC capabilities that can be accessed by changing the resolution to 12. This will return values from analogRead() between 0 and 4095.
2^12 = 4096;
2^14 = 16384;
2^16 = 65536;
The Portenta H7 has a 16 bit ADC, which will allow values between 0 and 65535.
3.2 millis()
Returns the number of milliseconds passed since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days.
time = millis()
Number of milliseconds passed since the program started. Data type: unsigned long.
Ref.
- Portenta H7 - Arduino Official
- Arduino® Portenta H7 Collective Datasheet
- analogReadResolution() - Arduino Reference
- millis() - Arduino Reference