Hello program for StepperMotorUni library

Dependencies:   StepperMotorUni mbed

Dependents:   StepperMotorUni_Hello

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  *  very simple sample of "StepperMotorUni" operation 
00004  * 
00005  *  version 1.0
00006  *  copyright: 2014 Tedd OKANO
00007  *  released under the Apache 2 license License
00008  */
00009 
00010 #include "mbed.h"
00011 #include "StepperMotorUni.h"
00012 
00013 StepperMotorUni motor( p26, p25, p24, p23 );
00014 
00015 int main()
00016 {
00017     motor.set_operation_phase_mode( StepperMotorUni::HALFSTEP );
00018     motor.set_pps( 200 );
00019 
00020     while ( 1 ) {
00021         motor.move_steps( 48 );
00022         wait( 1 );
00023 
00024         motor.move_steps( -48 );
00025         wait( 1 );
00026     }
00027 }