![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
no optics
Dependencies: Stepper mbed PinDetect
Diff: main.cpp
- Revision:
- 3:af3195b3330d
- Parent:
- 2:65c5232b9465
--- a/main.cpp Wed Sep 04 18:03:54 2019 +0000 +++ b/main.cpp Wed Sep 04 18:47:29 2019 +0000 @@ -19,34 +19,13 @@ while(1) { pc.printf("\n\n\nEnter desired position: "); - pc.scanf("%d",&slot); + pc.scanf("%d",&slot); + en = 0; //turns on stepper driver - mot.goesTo(slot*100); // move to absolute 100 + mot.goesTo(slot*1000); // move to absolute slot*500 step position while(!mot.stopped()); // while motor is turning...do line below steps = mot.getPosition(); //read in absolute step postition - while(optic == 0) - { - wait(1); - mot.goesTo(steps+25); //go to absolute step position - while(!mot.stopped()); - steps = mot.getPosition(); - pc.printf("\nNot in Position", steps); - } pc.printf("\nIn Position"); en = 1; //disable the motor and driver - //if (tickcount<steps) - //{ - //mot.goesTo(steps+25); - //while(!mot.stopped()); - //steps = mot.getPosition(); - //pc.printf("\nNot in Position", steps); - //} - //if (tickcount>steps) - //{ - //mot.goesTo(steps-25); - //while(!mot.stopped()); - //steps = mot.getPosition(); - //pc.printf("\nNot in Position", steps); - //} } }