|
|
4 лет назад | |
|---|---|---|
| .. | ||
| main | 4 лет назад | |
| CMakeLists.txt | 4 лет назад | |
| README.md | 4 лет назад | |
(See the README.md file in the upper level 'examples' directory for more information about examples.)
This example demonstrates the following:
In this example, you need to connect a voltage source (e.g. a DC power supply) to the GPIO pins specified in single_read.c (see the macros defined on the top of the source file). Feel free to modify the pin setting.
Build the project and flash it to the board, then run monitor tool to view serial output:
idf.py -p PORT flash monitor
(To exit the serial monitor, type Ctrl-].)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
Running this example, you will see the following log output on the serial monitor:
I (302) ADC1_CH2: raw data: 4095
I (302) ADC1_CH2: cali data: 3109 mV
I (1302) ADC2_CH0: raw data: 0
I (1302) ADC2_CH0: cali data: 0 mV
I (2302) ADC1_CH2: raw data: 4095
I (2302) ADC1_CH2: cali data: 3109 mV
I (3302) ADC2_CH0: raw data: 0
I (3302) ADC2_CH0: cali data: 0 mV
I (4302) ADC1_CH2: raw data: 4095
I (4302) ADC1_CH2: cali data: 3109 mV
...
If following warning is printed out, it means the calibration required eFuse bits are not burnt correctly on your board. The calibration will be skipped. Only raw data will be printed out.
W (300) ADC SINGLE: eFuse not burnt, skip calibration
I (1310) ADC2_CH0: raw data: 2715