Main Content

Motor Carrier

Control motors connected to Motor Carrier

Control servo, DC motors M1 and M2 in closed loop control using two encoder inputs on the MKR Motor Carrier or Nano Motor Carrier. Create arduino object before using the motor carrier functions. See Connect to Arduino Hardware for more information.

Functions

expand all

motorCarrierConnection to Arduino MKR Motor Carrier or Nano Motor Carrier (Since R2020b)
dcmotorConnection to DC Motor on Arduino MKR Motor Carrier or Nano Motor Carrier (Since R2020a)
startStart DC motor connected to MKR Motor Carrier or Nano Motor Carrier (Since R2020a)
stopStop DC motor connected to MKR Motor Carrier or Nano Motor Carrier (Since R2020a)
pidMotorConnection to motors in closed-loop PID control on Arduino MKR Motor Carrier or Nano Motor Carrier (Since R2020a)
readAngularPositionRead angular position of DC Motor in closed-loop control (Since R2020a)
readSpeedRead current rotational speed of DC Motor in closed loop control (Since R2020a)
writeAngularPositionRotate DC motor by specified angle in closed loop position control (Since R2020a)
writeSpeedWrite speed of PID motor (Since R2020a)
rotaryEncoderConnection to rotary encoder on Arduino MKR Motor Carrier or Nano Motor Carrier (Since R2020a)
readCountRead current count value from encoder connected to MKR Motor Carrier or Nano Motor Carrier (Since R2020a)
readSpeedRead current rotational speed of motor from rotary encoder (Since R2020a)
resetCountSet encoder count value to zero or specified value (Since R2020a)
servoConnection to servo motor on Arduino MKR Motor Carrier or Nano Motor Carrier (Since R2020a)
writePositionWrite position of servo motor connected to MKR Motor Carrier or Nano Motor Carrier (Since R2020a)

Topics

Featured Examples