Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
counter Class Reference
Includes. More...
#include <counter.h>
Public Member Functions | |
| counter (PinName channelA) | |
| Constructor. | |
| void | reset (void) |
| Reset the encoder. | |
| int | getPulses (void) |
| Read the number of pulses recorded by the encoder. | |
Detailed Description
Includes.
Simple counter
Definition at line 12 of file counter.h.
Constructor & Destructor Documentation
| counter | ( | PinName | channelA ) |
Constructor.
Attaches the encode function to the rise edge of channel A.
- Parameters:
-
channelA mbed pin for counter input.
Definition at line 8 of file counter.cpp.
Member Function Documentation
| int getPulses | ( | void | ) |
Read the number of pulses recorded by the encoder.
- Returns:
- Number of pulses which have occured.
Definition at line 21 of file counter.cpp.
| void reset | ( | void | ) |
Generated on Mon Jul 18 2022 02:03:22 by
1.7.2