Encoder

Class Documentation

class compLib.Encoder.Encoder

Class used to read the encoders

static clear(port: int)

Reset encoder position to 0

Parameters

port – Port, which the motor is connected to. Between 1 and 4

Raises

IndexError

static clear_all()

Reset all encoder positions to 0

static read(port: int) → int

Read encoder from a specified port

Parameters

port – Port, which the motor is connected to. Between 1 and 4

Raises

IndexError

Returns

Current encoder position

static read_raw(port: int) → int

Read raw encoder from a specified port. Will not be reset to 0 at start.

Parameters

port – Port, which the motor is connected to. Between 1 and 4

Raises

IndexError

Returns

Current encoder position