ExtEncoder Unit

The following products are supported:

ExtEncoderUnit

class ExtEncoderUnit

Constructors

class ExtEncoderUnit(i2c, address: int | list | tuple = 0x59)

Creates a Rotary object.

UIFLOW2:

init.svg

Methods

ExtEncoderUnit.get_rotary_status() bool

Gets the rotation status of the Rotary object.

UIFLOW2:

get_rotary_status.svg

ExtEncoderUnit.get_rotary_value() int

Gets the rotation value of the Rotary object.

UIFLOW2:

get_rotary_value.svg

ExtEncoderUnit.get_rotary_increments() int

Gets the rotation increment of the Rotary object. Can be used to determine the direction of rotation.

UIFLOW2:

get_rotary_increments.svg

ExtEncoderUnit.reset_rotary_value() None

Resets the rotation value of the Rotary object.

UIFLOW2:

reset_rotary_value.svg

ExtEncoderUnit.set_rotary_value(new_value: int) None

Sets the rotation value of the Rotary object.

Parameters:

new_value (int) – adjust the current value.

UIFLOW2:

set_rotary_value.svg

ExtEncoderUnit.get_perimeter() int

Gets the perimeter of the Rotary object. The unit is millimeters.

UIFLOW2:

get_perimeter.svg

ExtEncoderUnit.set_perimeter(perimeter: int) None

Sets the perimeter of the Rotary object.

Parameters:

perimeter (int) – the perimeter of the Rotary object. The unit is millimeters.

UIFLOW2:

set_perimeter.svg

ExtEncoderUnit.get_pulse() int

pluse per round.

UIFLOW2:

get_pulse.svg

ExtEncoderUnit.set_pulse(pulse: int) None

Sets the pulse per round.

Parameters:

pulse (int) – the pulse per round.

UIFLOW2:

set_pulse.svg

ExtEncoderUnit.get_zero_mode() int

Gets the zero mode of the Rotary object.

UIFLOW2:

get_zero_mode.svg

ExtEncoderUnit.set_zero_mode(mode: int) None

Sets the zero mode of the Rotary object.

Parameters:

mode (int) – the zero mode of the Rotary object.

UIFLOW2:

set_zero_mode.svg

ExtEncoderUnit.get_meter_value() int

Gets the meter value of the Rotary object. The unit is millimeters.

UIFLOW2:

get_meter_value.svg

ExtEncoderUnit.get_zero_pulse_value() int

Gets the zero pulse value of the Rotary object.

UIFLOW2:

get_zero_pulse_value.svg

ExtEncoderUnit.set_zero_pulse_value(value: int) None

Sets the zero pulse value of the Rotary object.

Parameters:

value (int) – the zero pulse value of the Rotary object.

UIFLOW2:

set_zero_pulse_value.svg

ExtEncoderUnit.get_firmware_version() int

读版本号

UIFLOW2:

get_firmware_version.svg

ExtEncoderUnit.set_address(address) int

设置i2c地址

UIFLOW2:

set_address.svg