Library pulse-counter

To use this library in your code:

import pulse-counter
Support for the ESP32 pulse counter (PCNT).
Each unit has two channels that can be configured independently. They share the same counter.
The ESP32 has 8 units.
The ESP32C3 has no pulse counter.
The ESP32C6 has 4 units.
The ESP32S2 has 4 units.
The ESP32S3 has 4 units.
Example

import pulse-counter

main:
  unit := pulse-counter.Unit 18
  while true:
    print unit.value
    sleep --ms=500

Classes

A pulse-counter channel.

A pulse-counter unit.