Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Encoder MODSERIAL
Diff: main.cpp
- Revision:
- 1:8fb04c532736
- Parent:
- 0:53c4dbb10a17
- Child:
- 2:5f175018d1ff
diff -r 53c4dbb10a17 -r 8fb04c532736 main.cpp
--- a/main.cpp Mon Nov 04 19:01:40 2013 +0000
+++ b/main.cpp Mon Nov 04 20:38:22 2013 +0000
@@ -53,7 +53,7 @@
/*floats van de filters van het emg*/
pc.baud(115200); // Defining the Baud rate for comunication with PC
/*EMG Variables 1*/
- float t
+ float t;
t = 0;
float hoek1, hoek2;
hoek1 = 0;
@@ -239,8 +239,11 @@
wait(Ts);
/*Defining the direction of the Motor*/
- emg_dir=f/*-ff; snelheid in de x richting. Of draaiing motor 1*/
- emg_dir2=fff/*-ffff; /*snelheid in de y richting. Of draaiing motor2*/
+ emg_dir=f*3;/*-ff; snelheid in de x richting. Of draaiing motor 1*/
+ emg_dir2=ff*3;/*-ffff; snelheid in de y richting. Of draaiing motor2*/
+
+ pc.printf("%f \n \r", emg_dir);
+ pc.printf("%f \n \r", emg_dir2);
//omzetten naar hoeksnelheden
//hoekV1 = emg_dir*29.5*cos(hoek2)-emg_dir2*29,5*sin(hoek2); //nu heb ik beide hoeksnelheden
@@ -343,7 +346,7 @@
motordir2.write(0);
}
//pwm_motor2.write(abs(pwm_to_motor2));
- pwm_motor2.write(abs(pwm_to_motor2);
+ pwm_motor2.write(abs(pwm_to_motor2));
//pc.printf("f:%f, emg_dir:%f, setpoint:%f, u:%f, pwm_to_motor:%d, motordir:%d \n \r",f,emg_dir,setpoint,u,pwm_to_motor,motordir.read());
}
}