rotaryEncoder
Connection to rotary encoder on Arduino MKR Motor Carrier or Nano Motor Carrier
Since R2020a
Add-On Required: This feature requires the MATLAB Support Package for Arduino Hardware add-on.
Description
This object represents a connection to the rotary encoder with the specified channel on the MKR Motor Carrier or Nano Motor Carrier. You can read from the rotary encoder in using Object Functions.
Creation
Description
creates a connection to the rotary encoder at the specified channel on the MKR Motor
carrier or Nano Motor Carrier.encoder
= rotaryEncoder(mcObj
,channelNumber
)
creates a connection to the rotary encoder at the specified channel with the specified
pulses per revolution on the MKR Motor Carrier or Nano Motor Carrier.encoder
= rotaryEncoder(mcObj
,channelNumber
,ppr
)
Input Arguments
Properties
Object Functions
Use object functions to with your rotary encoder.
readCount | Read current count value from encoder connected to MKR Motor Carrier or Nano Motor Carrier |
readSpeed | Read current rotational speed of motor from rotary encoder |
resetCount | Set encoder count value to zero or specified value |
Examples
Version History
Introduced in R2020a
See Also
arduino
| dcmotor
| motorCarrier
| pidMotor
| servo