821c70f5d7
* Use "example" in all example function & variable names, ie use i2c_example_xxx instead of i2c_xxx for example functions. Closes #198 https://github.com/espressif/esp-idf/issues/198 * Mark example functions, etc. static * Replace uses of "test" & "demo" with "example" * Split the UART example into two * Rename "main" example files to end with "_main.c" for disambiguation |
||
---|---|---|
.. | ||
main | ||
Makefile | ||
README.md |
Example: pcnt
This example uses the pulse counter module (PCNT) to count the rising edges of pulses generated by the LED Controller module (LEDC).
By default GPIO18 is used as output pin, GPIO4 is used as pulse input pin and GPIO5 is used as control input pin. This configuration (pin numbers, etc.) can be modified in top of the main/pcnt_test.c file.
- Open serial port to view the message printed on your screen
- To do this test, you should connect GPIO18 with GPIO4
- GPIO5 is the control signal, you can leave it floating with internal pulled up, or connect it to ground. HIGH = Count increases, LOW = count decreases.
- An interrupt is configured to trigger when the count reaches threshold values.
- The counter will reset when it reaches the limit values.