Defines | |
#define | LEFT 0 |
Left wheel. | |
#define | RIGHT 1 |
Right wheel. | |
#define | ENCODER_MAGNET_FAILURE 1025 |
Magnet misaligned - likely distance from encoder problem. | |
#define | ENCODER_MISALIGNED 1027 |
Encoder misaligned - likely on XY plane. | |
#define | ENCODER_DATA_NOT_READY 1026 |
Not enough time has passed - encoders not initialized in hardware. | |
#define | ENCODER_DELAY 20 |
delay_ms argument after a full read is complete | |
#define | OCF _BV(4) |
#define | COF _BV(3) |
#define | LIN _BV(2) |
#define | MagINCn _BV(1) |
#define | MagDECn _BV(0) |
#define | BUFFER_SIZE 23 |
Buffer size. | |
Functions | |
void | encoders_init (void) |
Initialize encoders. | |
int | encoder_read (char encoder) |
Read instantaneous encoder value. | |
int | encoder_get_dx (char encoder) |
Get total distance traveled. | |
void | encoder_rst_dx (char encoder) |
Reset distance counter. | |
int | encoder_get_tc (void) |
Get time count: The number of encoder reads that have occurred. | |
void | encoder_rst_tc (void) |
Reset the time count. | |
void | encoder_wait (int nReadings) |
Waits for the next n encoder reading, then returns. |
int encoder_get_dx | ( | char | encoder | ) |
int encoder_get_tc | ( | void | ) |
Get time count: The number of encoder reads that have occurred.
Get time count: The number of encoder reads that have occurred.
int encoder_read | ( | char | encoder | ) |
Read instantaneous encoder value.
Read instantaneous encoder value.
encoder | this is the encoder that you want to read. Valid arguments are LEFT and RIGHT |
Referenced by odometry_reset().
void encoder_rst_dx | ( | char | encoder | ) |
void encoder_wait | ( | int | n | ) |
Waits for the next n encoder reading, then returns.
Waits for the next n encoder reading, then returns.
n |