- ID: wheelencoder
- Name: Wheel Encoder
- Category: other
- Manufacturer: dfrobot
- Link: http://www.dfrobot.com/index.php?route=product/product&product_id=98
- Connection: gpio
This sensor was developed for the DFRobot Wheel Encoder, though it could be used for any counting time-based task.
When you instantiate a class of this type, the gpio pin specified is connected to an interrupt. Whenever a low to high transition occurs on the gpio pin, the internal counter is incremented by one.
This class also includes a millisecond counter, so that you can correlate the number of counts to a time period for calculating an RPM or other value as needed.
DFRobot Wheel Encoder sensor constructor
Digital pin to use
Returns the number of milliseconds elapsed since initClock() was last called.
Resets the clock
Resets the counter to 0. The counter should be stopped via stopCounter() prior to calling this function.
Starts the counter. This function will also clear the current count and reset the clock.
Stops the counter
Gets the current counter value