|
|
5 лет назад | |
|---|---|---|
| .. | ||
| main | 5 лет назад | |
| CMakeLists.txt | 5 лет назад | |
| Makefile | 8 лет назад | |
| README.md | 5 лет назад | |
| Supported Targets | ESP32 |
|---|
(See the README.md file in the upper level 'examples' directory for more information about examples.)
In this example, we use ADC2 to measure the output of DAC.
We use ADC1_CHANNEL_7 (GPIO27) and DAC_CHANNEL_1 (GPIO25) by default, you need to short the two GPIOs (if you have changed the ADC2 and DAC channel, please refer to Chapter 4.11 of the ESP32 Technical Reference Manual to get the pin number).
We use ADC1_CHANNEL_7 (GPIO18) and DAC_CHANNEL_1 (GPIO17) by default, you need to short the two GPIOs (if you have changed the ADC2 and DAC channel, please refer to the ESP32S2 Technical Reference Manual to get the pin number).
idf.py menuconfig
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:
ADC channel 7 @ GPIO 27, DAC channel 1 @ GPIO 25.
adc2_init...
start conversion.
1: 150
2: 203
3: 250
4: 300
5: 351
6: 400
7: 441
8: 491
9: 547
10: 595
...
ADC channel 7 @ GPIO 18, DAC channel 1 @ GPIO 17.
adc2_init...
start conversion.
1: 150
2: 203
3: 250
4: 300
5: 351
6: 400
7: 441
8: 491
9: 547
10: 595
...
program upload failure
idf.py -p PORT monitor, and reboot your board to see if there are any output logs.menuconfig menu, and try again.For any technical queries, please open an issue on GitHub. We will get back to you soon.