|
R2R
|
Encoder source code. More...
Macros | |
| #define | NUM_SSI_DATA2 5 |
Functions | |
| void | encoderSPIInit (void) |
| Initializes the SPI channels for the motor drivers, encoders, and RAM. More... | |
| void | encoderRead (void) |
| Updates value in sensor array. More... | |
| void | zeroMotor1RawRelative (void) |
| Reads value of motor 1 encoders and sets the relative angle to zero. More... | |
| void | zeroMotor2RawRelative (void) |
| Reads value of motor 2 encoders and sets the relative angle to zero. More... | |
| void | resetMotor1RawRelative (void) |
| Resets the relative counts on encoder 1. More... | |
| void | resetMotor2RawRelative (void) |
| Resets the relative counts on encoder 2. More... | |
| int | readMotor1RawRelative (void) |
| Reads value in encoderVal array for motor 1 and keeps track of multiturn counts. More... | |
| int | readMotor2RawRelative (void) |
| Reads value in encoderVal array for motor 2 and keeps track of multiturn counts. More... | |
| float | readMotor2Speed (void) |
| float | readMotor1Speed (void) |
| float | readMotor1AngleRelative (void) |
| Reads value in encoderVal array for motor 1 and keeps track of multiturn angles. More... | |
| float | readMotor2AngleRelative (void) |
| Reads value in encoderVal array for motor 2 and keeps track of multiturn angles. More... | |
| float | readMotor1RadRelative (void) |
| float | readMotor2RadRelative (void) |
| int | readMotor2Raw (void) |
| Reads value in encoderVal array for motor 2. More... | |
| int | readMotor1Raw (void) |
| Reads value in encoderVal array for motor 1. More... | |
| float | readMotor1Angle (void) |
| Reads value in encoderVal array for motor 1 and converts it to an angle. More... | |
| float | readMotor2Angle (void) |
| Reads value in encoderVal array for motor 2 and converts it to an angle. More... | |
| float | readMotor1Rad (void) |
| float | readMotor2Rad (void) |
Encoder source code.
This file contains functions for initializing and reading from encoders.
| void encoderRead | ( | void | ) |
Updates value in sensor array.
This function reads both encoder counts and stores them in an array
Comes after: spiInit();
Writes to: encoderVal array
| void encoderSPIInit | ( | void | ) |
Initializes the SPI channels for the motor drivers, encoders, and RAM.
Initializes SSI1 ~ 4 and their corresponding GPIO pins
| Void |
| float readMotor1Angle | ( | void | ) |
Reads value in encoderVal array for motor 1 and converts it to an angle.
| Void |
| float readMotor1AngleRelative | ( | void | ) |
Reads value in encoderVal array for motor 1 and keeps track of multiturn angles.
This function reads out the angle and keeps track of it for multiple turns.
| Void |
| int readMotor1Raw | ( | void | ) |
Reads value in encoderVal array for motor 1.
The range for the read angle is 0 to 16383
| Void |
| int readMotor1RawRelative | ( | void | ) |
Reads value in encoderVal array for motor 1 and keeps track of multiturn counts.
This function reads out the angle and keeps track of it for multiple turns. The value ranges from -2,147,483,648 to 2,147,483,648. Each turn is 16383 counts
| Void |
| float readMotor2Angle | ( | void | ) |
Reads value in encoderVal array for motor 2 and converts it to an angle.
| Void |
| float readMotor2AngleRelative | ( | void | ) |
Reads value in encoderVal array for motor 2 and keeps track of multiturn angles.
This function reads out the angle and keeps track of it for multiple turns.
| Void |
| int readMotor2Raw | ( | void | ) |
Reads value in encoderVal array for motor 2.
The range for the read angle is 0 to 16383
| Void |
| int readMotor2RawRelative | ( | void | ) |
Reads value in encoderVal array for motor 2 and keeps track of multiturn counts.
This function reads out the angle and keeps track of it for multiple turns. The value ranges from -2,147,483,648 to 2,147,483,648
| Void |
| void resetMotor1RawRelative | ( | void | ) |
Resets the relative counts on encoder 1.
| Void |
| void resetMotor2RawRelative | ( | void | ) |
Resets the relative counts on encoder 2.
| Void |
| void zeroMotor1RawRelative | ( | void | ) |
Reads value of motor 1 encoders and sets the relative angle to zero.
| Void |
| void zeroMotor2RawRelative | ( | void | ) |
Reads value of motor 2 encoders and sets the relative angle to zero.
| Void |
1.8.14