esp-idf/examples/peripherals/pcnt
Angus Gratton 821c70f5d7 examples: Standardise naming of files, symbols, etc. in examples
* 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
2017-03-27 17:42:05 +11:00
..
main examples: Standardise naming of files, symbols, etc. in examples 2017-03-27 17:42:05 +11:00
Makefile Moved examples to new folders / categories. Removed example numbers from example names 2017-01-16 23:08:35 +01:00
README.md Moved examples to new folders / categories. Removed example numbers from example names 2017-01-16 23:08:35 +01:00

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.