Encoder
Measure rotation of motor in ticks
Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.
Libraries:
Simulink Support Package for Arduino Hardware /
Arduino Motor Carrier
Description
The Encoder block reads the position and rotational speed of the motor from an encoder that is connected to an MKR or Nano Motor Carrier. The position is measured in ticks, and the speed is measured in ticks per second. Every increment in the tick count indicates a clockwise rotation, and every decrement in the tick count indicates a counterclockwise rotation.
If you simulate a model that contains the Encoder block without connecting the hardware, the block outputs zeroes. For more information, see Block Produces Zeros or Does Nothing in Simulation.
Ports
Output
Parameters
More About
Version History
Introduced in R2019a