|
|
8 лет назад | |
|---|---|---|
| .. | ||
| main | 8 лет назад | |
| Makefile | 9 лет назад | |
| README.md | 8 лет назад | |
This example uses the pulse counter module (PCNT) to count the rising edges of the PWM pulses generated by the LED Controller module (LEDC).
The examples is setting up and then using the following GPIO pins:
The configuration parameters of this example (pin numbers, etc.) may be modified at the top of the main/pcnt_test.c file.
1, Compile and load the example.
The example will print out the current counter values and events.
An interrupt will be triggered when the counter value:
A sample output on the serial monitor:
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
...
See the README.md file in the upper level 'examples' directory for more information about examples.