Рет қаралды 22,356
This video shows off a new pulsecnt module for the ESP32 NodeMCU firmware. The pulsecnt library handles sophisticated and automatic pulse counting using the built-in hardware on ESP32. The pulsecnt library gives you a means to not rely on GPIO triggers to do your pulse counting and instead offload the work to independent hardware. You gain the ability to count pulses up to 80Mhz (speed of APB clock).
You can get a callback to Lua when different counting thresholds are reached, or when upper or lower counting limits are hit. You can count pulses on all GPIO ports. There is also a way to provide a control GPIO for ignoring or decrementing pulses when the control signal is high or low.
The Github repo for the pulsecnt library is at github.com/chi...
Example code for different types of pulse counter implementations is available as Gists on Github.
Example Pulse Counter for 1 channel with no control gpio
gist.github.co...
Example Pulse Counter for hall effect sensor plus 1 push button to control direction of count
gist.github.co...
Example Pulse Counter for 1 channel for polling pulse count (no callback)
gist.github.co...