Encoder

public class Encoder

This is the Encoder class. This tracks the position of a motor of class DcMotorEx. The motor must have an encoder attached. It can also get changes in position.

Author

Anyi Lin - 10158 Scott's Bots

Constructors

Link copied to clipboard
public void Encoder(DcMotorEx setMotor)
This creates a new Encoder from a DcMotorEx.

Properties

Link copied to clipboard
public final static double FORWARD
Link copied to clipboard
public double multiplier
Link copied to clipboard
public final static double REVERSE

Functions

Link copied to clipboard
public double getDeltaPosition()
This returns the change in position from the previous position to the current position.
Link copied to clipboard
public double getMultiplier()
This returns the multiplier/direction of the Encoder.
Link copied to clipboard
public void reset()
This resets the Encoder's position and the current and previous position in the code.
Link copied to clipboard
public void setDirection(double setMultiplier)
This sets the direction/multiplier of the Encoder.
Link copied to clipboard
public void update()
This updates the Encoder's tracked current position and previous position.