Setting Encoder Position
You can reset the encoder on the Thrifty Nova to be at some specific value. The current position of the encoder will real as the set value, and all the other readings will be adjusted accordingly. The position needs to be passed in encoder units, so it can be wise to use conversions.
Encoder Types
The Thrifty Nova supports three types of encoders, each with different capabilities:
Encoder Type | Resolution | Position | Velocity | Notes |
---|---|---|---|---|
| 42 counts/rev | ✓ | ✓ | Built into NEO motors |
| 4096 counts/rev | ✓ | ✓ | External quadrature encoder |
| 4096 counts/rev | ✓ | X | External absolute encoder |
Setting Up Encoders
First, tell the motor which encoder type you're using:
Usage Examples
The following example sets the encoder to be currently at the zero position.
And this example sets the current position to read as 21 encoder units.
API Details for setEncoderPosition
setEncoderPosition
Sets the encoder position.
Parameters:
position The position to set the encoder to.
Last updated