TI RSLK Library 0.2.2
Loading...
Searching...
No Matches
Encoder.h
Go to the documentation of this file.
1
2#include <stdint.h>
3
4#ifndef Encoder_h
5#define Encoder_h
6
15void setupEncoder(uint8_t ela_pin, uint8_t elb_pin, uint8_t era_pin, uint8_t erb_pin);
16
25uint32_t getEncoderLeftCnt();
26
31uint32_t getEncoderRightCnt();
32
36
40
45#define WHEEL_DIR_FORWARD 1
46
50#define WHEEL_DIR_BACKWARD 0
57uint8_t getLeftWheelDir();
58
63uint8_t getRightWheelDir();
64
67#endif
void setupEncoder(uint8_t ela_pin, uint8_t elb_pin, uint8_t era_pin, uint8_t erb_pin)
Initialize the wheel encoder.
Definition Encoder.cpp:33
uint8_t getLeftWheelDir()
Determines if the left wheel is going forward or backwards.
Definition Encoder.cpp:71
uint8_t getRightWheelDir()
Determines if the right wheel is going forward or backwards.
Definition Encoder.cpp:75
void resetRightEncoderCnt()
Set the right encoder tick count to 0.
Definition Encoder.cpp:66
void resetLeftEncoderCnt()
Set the left encoder tick count to 0.
Definition Encoder.cpp:61
uint32_t getEncoderLeftCnt()
Return number of encoder ticks from the left wheel.
Definition Encoder.cpp:56
uint32_t getEncoderRightCnt()
Return number of encoder ticks from the right wheel.
Definition Encoder.cpp:51