|
TI RSLK Library
0.2.0
|
#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | WHEEL_DIR_FORWARD 1 |
| Value used to reference wheel going forward. | |
| #define | WHEEL_DIR_BACKWARD 0 |
| Value used to reference wheel going backwards. | |
Functions | |
| void | setupEncoder (uint8_t ela_pin, uint8_t elb_pin, uint8_t era_pin, uint8_t erb_pin) |
| Initialize the wheel encoder. More... | |
| uint32_t | getEncoderLeftCnt () |
| Return number of encoder ticks from the left wheel. More... | |
| uint32_t | getEncoderRightCnt () |
| Return number of encoder ticks from the right wheel. More... | |
| void | resetLeftEncoderCnt () |
| Set the left encoder tick count to 0. | |
| void | resetRightEncoderCnt () |
| Set the right encoder tick count to 0. | |
| uint8_t | getLeftWheelDir () |
| Determines if the left wheel is going forward or backwards. More... | |
| uint8_t | getRightWheelDir () |
| Determines if the right wheel is going forward or backwards. More... | |
| uint32_t getEncoderLeftCnt | ( | ) |
Return number of encoder ticks from the left wheel.
Definition at line 53 of file Encoder.cpp.
| uint32_t getEncoderRightCnt | ( | ) |
Return number of encoder ticks from the right wheel.
Definition at line 49 of file Encoder.cpp.
| uint8_t getLeftWheelDir | ( | ) |
Determines if the left wheel is going forward or backwards.
Definition at line 65 of file Encoder.cpp.
| uint8_t getRightWheelDir | ( | ) |
Determines if the right wheel is going forward or backwards.
Definition at line 68 of file Encoder.cpp.
| void setupEncoder | ( | uint8_t | ela_pin, |
| uint8_t | elb_pin, | ||
| uint8_t | era_pin, | ||
| uint8_t | erb_pin | ||
| ) |
Initialize the wheel encoder.
| [in] | ela_pin | pin number on Launchpad connected to ELA pin on encoder. |
| [in] | elb_pin | pin number on Launchpad connected to ELB pin on encoder. |
| [in] | era_pin | pin number on Launchpad connected to ERA pin on encoder. |
| [in] | erb_pin | pin number on Launchpad connected to ERB pin on encoder. |
This function needs to be called before any other encoder function is used.
Definition at line 32 of file Encoder.cpp.
1.8.16