Servo example
Dependencies: Stepper mbed Servo UniServ
EncoderCounter Class Reference
This class implements a driver to read the quadrature encoder counter of the STM32 microcontroller. More...
#include <EncoderCounter.h>
Public Member Functions | |
EncoderCounter (PinName a, PinName b) | |
Creates and initializes the driver to read the quadrature encoder counter of the STM32 microcontroller. | |
void | reset () |
Resets the counter value to zero. | |
void | reset (int16_t offset) |
Resets the counter value to a given offset value. | |
int16_t | read () |
Reads the quadrature encoder counter value. | |
operator int16_t () | |
The empty operator is a shorthand notation of the read() method. |
Detailed Description
This class implements a driver to read the quadrature encoder counter of the STM32 microcontroller.
Definition at line 18 of file EncoderCounter.h.
Constructor & Destructor Documentation
EncoderCounter | ( | PinName | a, |
PinName | b | ||
) |
Creates and initializes the driver to read the quadrature encoder counter of the STM32 microcontroller.
- Parameters:
-
a the input pin for the channel A. b the input pin for the channel B.
Definition at line 17 of file EncoderCounter.cpp.
Member Function Documentation
operator int16_t | ( | ) |
The empty operator is a shorthand notation of the read()
method.
Definition at line 165 of file EncoderCounter.cpp.
int16_t read | ( | ) |
Reads the quadrature encoder counter value.
- Returns:
- the quadrature encoder counter as a signed 16-bit integer value.
Definition at line 157 of file EncoderCounter.cpp.
void reset | ( | ) |
Resets the counter value to zero.
Definition at line 139 of file EncoderCounter.cpp.
void reset | ( | int16_t | offset ) |
Resets the counter value to a given offset value.
- Parameters:
-
offset the offset value to reset the counter to.
Definition at line 148 of file EncoderCounter.cpp.
Generated on Thu Jul 21 2022 09:23:25 by 1.7.2