27964 Parallax Inc, 27964 Datasheet - Page 5

UNIPOLAR STEPPER MOTOR 12VDC

27964

Manufacturer Part Number
27964
Description
UNIPOLAR STEPPER MOTOR 12VDC
Manufacturer
Parallax Inc
Datasheet

Specifications of 27964

Accessory Type
Unipolar Stepper Motor
For Use With/related Products
BASIC Stamp®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
M425P-5
Step_Fwd:
Step_Rev:
Do_Step:
Javelin Stamp Application
This program demonstrates basic, full-step control of a unipolar stepper motor using the Javelin Stamp
microcontroller. The Stepper class handles the connection details and contains methods that allow the
programmer to specify the number of steps, as well as the delay (in milliseconds between steps).
Stepper Motor Class
package stamp.misc;
import stamp.core.*;
public class Stepper {
© Parallax, Inc. • Unipolar Stepper Motor (#27964) • 02/2006
NEXT
PAUSE 500
GOTO Main
END
stpIdx = stpIdx + 1 // 4
GOTO Do_Step
stpIdx = stpIdx + 3 // 4
GOTO Do_Step
READ (Steps + stpIdx), Phase
PAUSE stpDelay
RETURN
private int stpIdx = 0;
private int ph1Pin;
private int ph2Pin;
private int ph3Pin;
private int ph4Pin;
public Stepper(int ph1Pin, int ph2Pin, int ph3Pin, int ph4Pin) {
}
private void setFullStep(int theStep) {
GOSUB Step_Rev
this.ph1Pin = ph1Pin;
this.ph2Pin = ph2Pin;
this.ph3Pin = ph3Pin;
this.ph4Pin = ph4Pin;
' rotate counter-clockwise
' wait 1/2 second
' point to next step
' point to previous step
' output new phase data
' pause between steps
// current step index
// phase 1 control pin
// phase 2 control pin
// phase 3 control pin
// phase 4 control pin
5

Related parts for 27964