Fernon Eijkhoudt
/
ROBOBIRDS_FINAL
EMG driven robot which shoots elastic bands
Fork of RoboBirdV1 by
Diff: main.cpp
- Revision:
- 9:4743f3bb39b2
- Parent:
- 8:a2b725b502d8
- Child:
- 10:e210675cbe71
diff -r a2b725b502d8 -r 4743f3bb39b2 main.cpp --- a/main.cpp Mon Sep 28 19:56:53 2015 +0000 +++ b/main.cpp Mon Sep 28 20:13:03 2015 +0000 @@ -31,21 +31,20 @@ pc.baud(115200); PowerMotor.write(0); Pot.attach(readpot,0.1); // Deze ticker moet de waarde uitlezen van de PotMeter 10 keer per seconde - //PC.attach(print,0.5); while (true) { Pulses = Encoder.getPulses(); Rotatie = (Pulses*twopi)/4192; Rotatietwopi = fmod(Rotatie,twopi); - pc.printf ("Potmeter = %f\n", z); // het weergeven van de waarde waar z (PotMeter) op dat moment is - pc.printf ("Rotatie = %f [radialen] \n", Rotatietwopi); - if (z > 0.05) { - Goal = pi; - } + + pc.printf ("Potmeter = %f\n", z);return 0; pc.printf ("Rotatie = %f [radialen] \n", Rotatietwopi); +// if (z > 0.05) { +// Goal = pi; +// } Error = Goal-Rotatietwopi; if (Error >= 0) { Direction =0; } else { - Direction =1; + Direction =1; } pc.printf("Error = %f\n Goal = %f\n", Error, Goal); v = K*fabs(Error); @@ -55,3 +54,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +