Matteus Car
/
motorController2
AccelMotor for Mbed
main.cpp
- Committer:
- abckcp
- Date:
- 2017-02-14
- Revision:
- 3:8d5c0d22d61d
- Parent:
- 1:71768fb30886
File content as of revision 3:8d5c0d22d61d:
/* sample program for AccelStepper.h inspired by the Bounce example of the Arduino version */ #include "AccelStepper.h" /** *** Main function **/ /*AccelStepper stepper(4, p21, p22, p23, p24); */ Timer t; /* int main() { t.start(); stepper.setMaxSpeed(200); stepper.setAcceleration(50); stepper.moveTo(500); stepper.setMinPulseWidth(50); while (true) { if (stepper.distanceToGo() == 0) stepper.moveTo(-stepper.currentPosition()); stepper.run(); } } */