|
RobotCore 1.0
WPILib port to raspberry Pi
|
The Encoder interface is implemented by classes which track an relative position. More...
Classes | |
| enum | EncoderType |
| Specifies the type of encoder. More... | |
Public Member Functions | |
| EncoderType | getType () |
| Encoder (EncoderType type, int pin1, int pin2, int i2cAddr) | |
| Encoder (EncoderType type, int pin1, int pin2, int i2cAddr, boolean group) | |
| Encoder (EncoderType type, int pin1, int pin2) | |
| Encoder (EncoderType type, int pin1, int pin2, boolean group) | |
| int | getRange () |
| int | getEncoderNo () |
| int | get () |
| int | getPosition () |
| int | getSpeed () |
| void | reset () |
| void | reset (int position) |
| void | setZero (int zero) |
| int | getZero () |
| void | setInverted (boolean invert) |
The Encoder interface is implemented by classes which track an relative position.
Definition at line 36 of file Encoder.java.
| robotCore.Encoder.Encoder | ( | ) |
Definition at line 191 of file Encoder.java.
| robotCore.Encoder.Encoder | ( | EncoderType | type, |
| int | pin1, | ||
| int | pin2, | ||
| int | i2cAddr ) |
| type | - Specifies the type of encoder |
| pin1 | - Specifies the first pin that the encoder uses. If it is a quadrature encoder, this must be the interrupt pin |
| pin2 | - Specifies the second pin that the encoder uses (Not use if type is simple) |
| i2cAddr | - Address of i2c arduino which reads encoder |
Definition at line 202 of file Encoder.java.
| robotCore.Encoder.Encoder | ( | EncoderType | type, |
| int | pin1, | ||
| int | pin2, | ||
| int | i2cAddr, | ||
| boolean | group ) |
| type | - Specifies the type of encoder |
| pin1 | - Specifies the first pin that the encoder uses. If it is a quadrature encoder, this must be the interrupt pin |
| pin2 | - Specifies the second pin that the encoder uses (Not use if type is simple) |
| i2cAddr | - Address of i2c microcontroller which reads encoder |
| group | - If this is true, then the reading of the position for this encoder is grouped with other encoders so that a single read will read multiple values. This is done to reduce the i2c speed bottleneck. |
Definition at line 219 of file Encoder.java.
| robotCore.Encoder.Encoder | ( | EncoderType | type, |
| int | pin1, | ||
| int | pin2 ) |
| type | - Specifies the type of encoder |
| pin1 | - Specifies the first pin that the encoder uses. If it is a quadrature encoder, this must be the interrupt pin |
| pin2 | - Specifies the second pin that the encoder uses (Not use if type is simple) |
Definition at line 230 of file Encoder.java.
| robotCore.Encoder.Encoder | ( | EncoderType | type, |
| int | pin1, | ||
| int | pin2, | ||
| boolean | group ) |
| type | - Specifies the type of encoder |
| pin1 | - Specifies the first pin that the encoder uses. If it is a quadrature encoder, this must be the interrupt pin |
| pin2 | - Specifies the second pin that the encoder uses (Not use if type is simple) |
| group | - If this is true, then the reading of the position for this encoder is grouped with other encoders so that a single read will read multiple values. This is done to reduce the i2c speed bottleneck. |
Definition at line 246 of file Encoder.java.
| int robotCore.Encoder.get | ( | ) |
Gets the current encoder value
Definition at line 273 of file Encoder.java.
| int robotCore.Encoder.getEncoderNo | ( | ) |
Definition at line 262 of file Encoder.java.
| int robotCore.Encoder.getPosition | ( | ) |
Gets the current encoder value
Definition at line 298 of file Encoder.java.
| int robotCore.Encoder.getRange | ( | ) |
Gets the range for the angle encoder
Definition at line 257 of file Encoder.java.
| int robotCore.Encoder.getSpeed | ( | ) |
Gets the current encoder value
Definition at line 313 of file Encoder.java.
| EncoderType robotCore.Encoder.getType | ( | ) |
Definition at line 105 of file Encoder.java.
| int robotCore.Encoder.getZero | ( | ) |
Definition at line 352 of file Encoder.java.
| void robotCore.Encoder.reset | ( | ) |
Resets the encoder to zero
Definition at line 328 of file Encoder.java.
| void robotCore.Encoder.reset | ( | int | position | ) |
Resets the encoder to the specified position.
| position | - Specifies the position to set. In the case of the Rotational encoder this should be the angle in encoder units. |
Definition at line 338 of file Encoder.java.
| void robotCore.Encoder.setInverted | ( | boolean | invert | ) |
| invert | = If True, the count and speed directions are reversed |
Definition at line 360 of file Encoder.java.
| void robotCore.Encoder.setZero | ( | int | zero | ) |
Sets the zero position for an AnalogRotational encoder.
| zero | - Specifies the encoder value for when the encoder is at it's zero position. |
Definition at line 348 of file Encoder.java.