no optics
Dependencies: Stepper mbed PinDetect
Revision 3:af3195b3330d, committed 2019-09-04
- Comitter:
- rschimpf78
- Date:
- Wed Sep 04 18:47:29 2019 +0000
- Parent:
- 2:65c5232b9465
- Commit message:
- no optics
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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);
- //}
}
}