This example shows how to read the values from an encoder connected to the SPARK MAX, specifically how to read their position and velocity values.
Set the variables at the beginning of the example to match your setup.
deviceID
- CAN device ID
Control the motor's velocity by moving the joystick up or down.
The position and velocity of the encoder will be displayed on SmartDashboard.