|
|
5 жил өмнө | |
|---|---|---|
| .. | ||
| main | 6 жил өмнө | |
| CMakeLists.txt | 5 жил өмнө | |
| Makefile | 9 жил өмнө | |
| README.md | 5 жил өмнө | |
| Supported Targets | ESP32 |
|---|
(See the README.md file in the upper level 'examples' directory for more information about examples.)
This example uses the pulse counter module (PCNT) to count the rising edges of the PWM pulses generated by the LED Controller module (LEDC).
Pin connection:
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.
Run this example, and you can see the following output log on the serial monitor: (Here, GPIO5 is connected to Ground)
Current counter value :-1
Current counter value :-2
Current counter value :-3
Current counter value :-4
Event PCNT unit[0]; cnt: -5
THRES0 EVT
Current counter value :-5
Current counter value :-6
Current counter value :-7
Current counter value :-8
Current counter value :-9
Event PCNT unit[0]; cnt: 0
L_LIM EVT
ZERO EVT
Current counter value :0
Current counter value :-1
...
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.