Main Content

release

Release stepper motor connected to Adafruit Motor Shield

Add-On Required: This feature requires the MATLAB Support Package for Arduino Hardware add-on.

Description

example

release(sm) releases the stepper motor, allowing it to rotate freely.

Examples

collapse all

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, and release it.

move(sm,10);
release(sm);

Input Arguments

collapse all

Stepper motor connection, specified as a stepper motor object, created using the stepper function.

Version History

Introduced in R2014b