final
Dependencies: Encoder HIDScope MODSERIAL TouchButton mbed-dsp mbed
Fork of Robot1_11 by
Diff: main.cpp
- Revision:
- 20:99a8e9da2d6d
- Parent:
- 19:0754c9563e01
- Child:
- 21:b7fb79882cb8
diff -r 0754c9563e01 -r 99a8e9da2d6d main.cpp --- a/main.cpp Fri Oct 31 11:10:47 2014 +0000 +++ b/main.cpp Fri Oct 31 13:17:30 2014 +0000 @@ -382,13 +382,13 @@ motordir1 = 1; stop = 0; looptimer1.attach(motor1aansturing,TSAMP1); - wait(1); ////is aan te passen (tijd die nodig is om balletje te slaan + wait(5); ////is aan te passen (tijd die nodig is om balletje te slaan looptimer1.detach(); pc.printf("detachMotor1\n"); Ticker looptimer3; looptimer3.attach(motor1aansturingdeel2,TSAMP1); - wait(1); ////is aan te passen (tijd die nodig is om balletje te slaan + wait(5); ////is aan te passen (tijd die nodig is om balletje te slaan looptimer3.detach(); pc.printf("detachMotor1\n"); @@ -473,9 +473,9 @@ pc.printf("Moving average T %f\r\n",MOVAVG_T); //sturen naar HID Scope - scope.set(0,emg_valueT); //ruwe data + /*scope.set(0,emg_valueT); //ruwe data scope.set(1,filtered_emgT); //filtered - scope.send(); + scope.send();*/ } void Biceps() @@ -558,9 +558,9 @@ pc.printf("Moving average B %f\r\n",MOVAVG_B); //naar HID Scope - scope.set(2,emg_valueB); //ruwe data + /*scope.set(2,emg_valueB); //ruwe data scope.set(3,filtered_emgB); //filtered - scope.send(); + scope.send();*/ } void Calibratie_Triceps() @@ -677,17 +677,17 @@ toestand = WACHTEN; motor1.setPosition(0); pid(0,0,true); - pc.printf("if1\n"); + //pc.printf("if2\n"); } if (toestand == TERUGKEREN) { new_pwm = pid(setspeed, motor1.getSpeed(),false); pwm_motor1.write(new_pwm); motordir1 = 0; - pc.printf("motor gaat terugkeren\n\r"); - pc.printf("new pwm %f\r\n",new_pwm); + + pc.printf("motor2.getPosition %d\r\n", motor2.getPosition()); } if (toestand == WACHTEN) { pwm_motor1.write(0); - pc.printf("ifwachten\n"); + //pc.printf("ifwachten2\n"); } } \ No newline at end of file