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.
QEI Class Reference
Quadrature Encoder Interface. More...
#include <QEI.h>
Public Member Functions | |
QEI (PinName channelA, PinName channelB, PinName index, int pulsesPerRev) | |
Constructor. | |
void | reset (void) |
Reset the encoder. | |
int | getCurrentState (void) |
Read the state of the encoder. | |
int | getPulses (void) |
Read the number of pulses recorded by the encoder. |
Detailed Description
Quadrature Encoder Interface.
Definition at line 127 of file QEI.h.
Constructor & Destructor Documentation
QEI | ( | PinName | channelA, |
PinName | channelB, | ||
PinName | index, | ||
int | pulsesPerRev | ||
) |
Constructor.
Reads the current values on channel A and channel B to determine the initial state.
Attaches the encode function to the rise/fall interrupt edges of channels A and B to perform X4 encoding.
Attaches the index function to the rise interrupt edge of channel index (if it is used) to count revolutions.
- Parameters:
-
channelA mbed pin for channel A input. channelB mbed pin for channel B input. index mbed pin for optional index channel input, (pass NC if not needed). pulsesPerRev Number of pulses in one revolution.
Member Function Documentation
int getCurrentState | ( | void | ) |
int getPulses | ( | void | ) |
Generated on Tue Jul 12 2022 11:13:38 by
