script dat de twee motoren los van elkaar laat draaien

Dependencies:   mbed Encoder MODSERIAL

Files at this revision

API Documentation at this revision

Comitter:
jaccoton
Date:
Mon Nov 04 20:38:22 2013 +0000
Parent:
0:53c4dbb10a17
Child:
2:5f175018d1ff
Commit message:
script dat de twee motoren kan laten draaien

Changed in this revision

Encoder.lib Show annotated file Show diff for this revision Revisions of this file
MODSERIAL.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Encoder.lib	Mon Nov 04 20:38:22 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/vsluiter/code/Encoder/#2dd7853c911a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MODSERIAL.lib	Mon Nov 04 20:38:22 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Sissors/code/MODSERIAL/#b04ce87dc424
--- 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());
     }
 }