Encoder#
Introduction#
The Optical Shaft Encoder measures the rotational position and speed of a shaft. It uses internal optical sensors to detect how far and how fast the shaft turns, making it useful for tracking wheel rotation, arm position, or other mechanisms.

Below is a list of available blocks:
set Encoder position – Sets the encoder’s current position to a specific value.
Encoder position – Returns how far the encoder has rotated.
Encoder velocity – Returns the current rotational speed of the encoder.
set Encoder position#
The set Encoder position block sets the encoder’s current position to a specified value.
set [EncoderA v] position to [0] degrees
Parameter |
Description |
|---|---|
device |
Which encoder to use, configured in the Devices window. |
position |
The rotational position to set in degrees. |
Encoder position#
The Encoder position block returns how far the shaft connected to the encoder has rotated.
([EncoderA v] position in [degrees v])
Parameter |
Description |
|---|---|
device |
Which encoder to use, configured in the Devices window. |
unit |
The unit that will represent the position:
|
Encoder velocity#
The Encoder velocity block returns the rotational speed of the encoder.
([EncoderA v] velocity in [dps v])
Parameter |
Description |
|---|---|
device |
Which encoder to use, configured in the Devices window. |
unit |
The unit that will represent the velocity:
|