LabVIEW Interface for Arduino Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

AdafruitMotorshieldVersion2DCMotorExample

Attached is an example using version 2 of the Adafruit Motor

Shield for use with one DC motor. This example does not use LIFA.

Note the following procedure assumes you have installed the

Adafruit Motor Shield Version 2 on your Arduino Uno, connected a DC  

motor to Motor Port M3.  If you use a different Motor Port you need to modify

this line of code  "Adafruit_DCMotor *myMotor = AFMS.getMotor(1);"

in the sketch.  Here 1 means Motor Port M1.  For Motor port M2 replace

the 1 with 2,  For Motor Port M3 replace the 1 with 3 and for Motor Port

M4 replace the 1 with 4.

The preferred power supply voltage for this shield is 12 volts DC.  Maximum

power supply voltage rating is 13.5 volts DC For additional information on using

the Adadfruit Motor Shield V2 with DC motors se:

<https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/using-dc-motors>

Installation Instructions

1.  Use 7zip to unpack AdafruitMotorShieldVersion2DCMotorExample.zip.

If you don't have a copy of 7zip you can get a copy here.

<http://www.7-zip.org/>

2.  Move the Adafrit_MotorShield  library to your Arduuino IDE "libraries" folder.

3. Move the DCMotorTestVersion2  sketch folder to your Arduino sketch folder.

4. Move the AdafruitV2MotorShieldDCMotorContrller.VI  to your your collection

of Labview examples folder.

5. Compile and download  the DCMotorTestVersion2sketch to your Adruino Uno.

Operating Instructions

6. Open the AdafruitV2MotorShieldDCMotorContrller.VI

7. On the front panel set the serial Port to your Arduino

Uno's COM port

8. Set the baud rate to 9600 bits per second.

9. Run the VI.

10  Set the "Speed"  to a value between -255 and 255.   The motor rotates

BACKWARD when the value is negative, FORWARD when the value is positive

and stops when the value is 0.  Maximum BACKWARD speed occurs when the

value is set to -255.  Maximum FORWARD speed occurs when the speed is set

to 255.

11.  Click on the "Send" button to send the "Speed" value to

the Arduino Uno and to start the motor rotating. 

12.  Most DC motors have considerable friction and will not rotate if the "Speed"

is set to to low of a value.  You may need to use a "Speed" value of 25 or higher to

start the motor rotating. 

13.  When reversing directions Adafruit recommends stopping the motor before

reversing the direction of rotation.

14.  To quit click on the "Stop" button.

hrh1818

Contributors