Attached is a zip file that contains 3 files for demonstrating the operation of the Auduino Motor Shield. The files in the zip file are an ArduinoMotorShieldTest sketch, an ArduinoMotorShieldStepperDRiver.VI and a X Running Sum.VI. This demo does not use LIFA.
The Arduino Motor Shield will work with either a Uniploar or a Bipolar Step Motor. A unipolar step motor will have two pairs of coils. Each pair has two coils connected in series with a center tap. Connect the center tap for each pair to ground. Connect one of the pairs to the A+ and A- terminals. Connect the other pair to the B+ and B- terminals. A bipolar step motor will have 2 coils. Connect one coil to the A+ and A- terminals. Connect the other coil to the B+ and B- terminals
The sketch is configured for a 200 steps per revolution step motor. If your sep motor has a different number of steps per revolution change the code in the second line in the sketch to match the steps per revolution value for your motor. Next compile and download the sketch to your Arduino board. You can test the sketch by using the Arduino Serial Monitor. Enter a positive integer in the Send text box and press Send. The step motor should start rotating. The number of steps the motor makes will be equal to the value of the integer you sent. To reverse direction of rotation send a negative integer.
To use the ArduinoMotorShieldStepperDriver.VI and X Running SumVI
Set Serial Port to the same COM port you used when downloading the sketch to the Arduino board.
Set X Step Setpoint to the number of steps you want the step moor to move.
Run the VI
Momentarily pres the the Send Switch.
The stepper motor should start rotating.
The X step Position indicator is a running sum of the number of steps the step motor has moved during a session.
hrh1818