This is a demo code for stepper motor

Dependencies:   StepperMotorUni mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // "Hello" program for StepperMotorUni class library
00002  
00003 
00004 #include "mbed.h"
00005 #include "StepperMotorUni.h"
00006 
00007 StepperMotorUni motor( PTB0, PTB1, PTB2, PTB3);
00008 int i;
00009 
00010 int main()
00011 {   motor.set_pps( 200 );
00012     for ( i = 200; i<1000; i=i+100) 
00013     {
00014         motor.move_steps(i);
00015         wait( 5 );
00016 
00017     }
00018 }