OVMS3-idf/examples/16_pcnt
2016-12-22 15:07:02 +11:00
..
main Examples: Add READMEs for examples which did not have them 2016-12-22 15:07:02 +11:00
Makefile Merge branch 'master' into feature/btdm_bluedroid 2016-11-29 18:38:37 +08:00
README.md Examples: Add READMEs for examples which did not have them 2016-12-22 15:07:02 +11: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.