Optical Shaft Encoder
R2026bRepresent connected Optical Shaft Encoder and read relative position of motor shaft in ticks
Libraries:
Simulink Coder Support Package for VEX EDR V5 Robot Brain /
Sensors
Description
Add-On Required: This feature requires the Simulink Coder Support Package for VEX EDR V5 Robot Brain add-on.
The Optical Shaft Encoder block represents an Optical Shaft Encoder that is connected to the 3-wire ports of VEX EDR V5 Robot Brain, and reads the relative position of the motor shaft in ticks. The value increments for anti-clockwise rotation and decrements for clockwise rotation of the motor shaft.
The tick count also depends on the Reset mode that you selected.
Ports
Input
Output
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"vexv5lib/Sensors/Optical Shaft Encoder"
Example: add_block("vexv5lib/Sensors/Optical Shaft Encoder","myModel/myBlock",MakeNameUnique="on")
Extended Capabilities
Version History
Introduced in R2019b

