Rotate stepper motor connected to Adafruit Motor Shield
Connect to Arduino® hardware and create an add-on connection to an Adafruit® Motor Shield.
a = arduino('COM4','Uno','Libraries','Adafruit/MotorShieldV2'); shield = addon(a,'Adafruit/MotorShieldV2');
Create a stepper motor connection to motor number
1 on the shield, with steps per revolution of 200 and an RPM of 10.
sm = stepper(shield,1,200,'RPM',10);
Rotate the motor 10 steps.
move command blocks MATLAB while it executes.
sm— Stepper motor connection
Stepper motor connection, specified as a stepper motor object,
created using the
steps— Number of steps
Number of steps that the stepper motor rotates, specified as a number.