
Motor + potmerer + EMG + led
Dependencies: HIDScope MODSERIAL mbed
Fork of EMG_Motor_LED by
Revision 6:df37e7d33513, committed 2018-10-10
- Comitter:
- CasperK
- Date:
- Wed Oct 10 11:48:55 2018 +0000
- Parent:
- 5:5442448ac4d1
- Commit message:
- Random crashes
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 5442448ac4d1 -r df37e7d33513 main.cpp --- a/main.cpp Wed Oct 10 10:47:36 2018 +0000 +++ b/main.cpp Wed Oct 10 11:48:55 2018 +0000 @@ -62,17 +62,17 @@ void Proces_states(){ switch (CurrentState){ case forward: //Funcion: Forward -// directionpin = 1; -// pwmpin.write(scaled_potmeter); //pwm of motor is potmeter value + directionpin = 1; + pwmpin.write(scaled_potmeter); //pwm of motor is potmeter value led.write(scaled_potmeter); //led is potmeter value break; case stop: //Funcion: Stop // do nothing break; case backwards: //Function: Backwards -// directionpin = 0; + directionpin = 0; c = scaled_potmeter*-1; -// pwmpin.write(c); //pwm of motor is potmeter value + pwmpin.write(c); //pwm of motor is potmeter value led.write(c); //led is potmeter value break; } @@ -86,6 +86,7 @@ led.period_us(60); //60 microseconds ticker.attach(&sendData, 0.005f); //send data to hidscope 1/0.005 = 200Hz sample_timer.attach(&sample, 0.002); //for the emg + pc.printf(" ** reset program **\r\n"); //______Scale potmeter___________// while (true) { @@ -118,7 +119,7 @@ /*empty loop, sample() is executed periodically*/ //while(1) {} } - + pc.printf(" **program stopped**\r\n"); }