MTR CTRL

Dependencies:   mbed

Dependents:   Nucleo_read_analog_value

Fork of motorController2 by 6408proj

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002   sample program for AccelStepper.h
00003   inspired by the Bounce example of the Arduino version
00004 
00005 
00006 */
00007 #include "AccelStepper.h"
00008 
00009 /**
00010 *** Main function
00011 **/
00012 
00013 /*AccelStepper stepper(4, p21, p22, p23, p24); */
00014 
00015 Timer t;
00016 /*
00017 int main() 
00018 {
00019   t.start();
00020   stepper.setMaxSpeed(200);
00021   stepper.setAcceleration(50);
00022   stepper.moveTo(500);
00023   stepper.setMinPulseWidth(50);
00024 
00025 
00026 
00027   while (true) {
00028     if (stepper.distanceToGo() == 0)
00029         stepper.moveTo(-stepper.currentPosition());
00030     stepper.run();
00031   }
00032 }
00033 */
00034