Encoder
Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.
Libraries:
Simulink Support Package for Arduino Hardware /
Sensors
Description
The Encoder block outputs the tick count from a quadrature encoder on a rotating motor connected to an Arduino® board. Every increment in the tick count of the encoder indicates that the motor is rotating clockwise. Every decrement in the tick count of the encoder indicates that the motor is rotating counterclockwise. The total tick count represents the incremental position of the rotating motor.
You can reset the encoder readings from the block using the Reset mode parameter in the block parameters dialog box.
When simulating without hardware, this block outputs zeros. For more information, see Block Produces Zeros or Does Nothing in Simulation.
Note
The Encoder block does not support the connected IO workflow on the Arduino Nano 33 BLE Sense board currently.
Ports
Input
Output
Parameters
Version History
Introduced in R2021b