ROEncoder provides access to the quadrature encoder inputs on your RobotOpen board. Using ROEncoder, the number of interrupts on each quad input can be read.
Creates an ROEncoder instance with the given encoder channel (the first channel typically being 0).
Returns the current 32 bit value of the encoder count.
NOTE: Sasquatch boards only. Sets the encoder count to a new value.
NOTE: Gorgon boards only. Resets the encoder count to 0.
NOTE: Gorgon boards only. Returns the current number of counts per second.
NOTE: Gorgon boards only. Used to adjust how often the coprocessor recalculates encoder counts and CPS. By default this is set to 4 samples. If you have an encoder that generates a very large number of counts per rotation (greater than a couple hundred), you may want to experiment with raising this number.
NOTE: Gorgon boards only. Sets the number of samples used in the averaging of the CPS value. Larger numbers will react less quickly, while lower numbers will be jumpier. The default is set to 9.
// create an encoder object ROEncoder leftDriveEncoder(1); // read the encoder count long mycount = leftDriveEncoder.read();