jacdac.rotary_encoder

Submodules

Package Contents

Classes

RotaryEncoderClient

An incremental rotary encoder - converts angular motion of a shaft to digital signal.

class jacdac.rotary_encoder.RotaryEncoderClient(bus: jacdac.bus.Bus, role: str, *, missing_position_value: Optional[int] = None)

Bases: jacdac.bus.SensorClient

An incremental rotary encoder - converts angular motion of a shaft to digital signal. Implements a client for the Rotary encoder service.

property position Optional[int]

Upon device reset starts at 0 (regardless of the shaft position). Increases by 1 for a clockwise “click”, by -1 for counter-clockwise., _: #

property clicks_per_turn Optional[int]

This specifies by how much position changes when the crank does 360 degree turn. Typically 12 or 24., _: #

property clicker Optional[bool]

(Optional) The encoder is combined with a clicker. If this is the case, the clicker button service should follow this service in the service list of the device.,