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:
Wed Nov 06 16:33:03 2013 +0000
Parent:
3:4db5e8ed9657
Commit message:
script potmeter uitleg opnieuw

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Nov 05 11:27:38 2013 +0000
+++ b/main.cpp	Wed Nov 06 16:33:03 2013 +0000
@@ -162,7 +162,7 @@
     
         /* EMG Filter 1*/
         //* EMG Filter 1*/
-        x = emg0.read();                    //Reading EMG value
+        //x = emg0.read();                    //Reading EMG value
         y = 0.638945525159022*x+1.277891050318045*x1+0.638945525159022*x2-y1*1.142980502539901-y2*0.412801598096189;    //Formula for highpass filter at 20Hz as given in slides
         z = y*0.391335772501769+y1*-0.782671545003537+y2*0.391335772501769-z1*-0.369527377351241-z2*0.195815712655833; // Formula for low pass filter at 40Hz instead of a Notch filter
         z = abs(z); //Rectify the signal
@@ -184,7 +184,7 @@
          //pc.printf("%f \n \r",(s1*f));
         
         /* EMG Filter 2*/
-        xx = emg1.read();                    //Reading EMG value
+        //xx = emg1.read();                    //Reading EMG value
         yy = 0.638945525159022*xx+1.277891050318045*xx1+0.638945525159022*xx2-yy1*1.142980502539901-yy2*0.412801598096189;    //Formula for highpass filter at 20Hz as given in slides
         zz = yy*0.391335772501769+yy1*-0.782671545003537+yy2*0.391335772501769-zz1*-0.369527377351241-zz2*0.195815712655833; // Formula for low pass filter at 40Hz instead of a Notch filter
         zz = abs(zz); //Rectify the signal
@@ -201,7 +201,7 @@
         if (ff<0.1)
         ff=0;
         /* EMG Filter 3*/
-        xxx = emg2.read();                    //Reading EMG value
+        //xxx = emg2.read();                    //Reading EMG value
         yyy = 0.638945525159022*xxx+1.277891050318045*xxx1+0.638945525159022*xxx2-yyy1*1.142980502539901-yyy2*0.412801598096189;    //Formula for highpass filter at 20Hz as given in slides
         zzz = yyy*0.391335772501769+yyy1*-0.782671545003537+yyy2*0.391335772501769-zzz1*-0.369527377351241-zzz2*0.195815712655833; // Formula for low pass filter at 40Hz instead of a Notch filter
         zzz = abs(zzz); //Rectify the signal
@@ -218,7 +218,7 @@
         if (fff<0.1)
         fff=0;
         /* EMG Filter 4*/
-        xxxx = emg3.read();                    //Reading EMG value
+        //xxxx = emg3.read();                    //Reading EMG value
         yyyy = 0.638945525159022*xxxx+1.277891050318045*xxxx1+0.638945525159022*xxxx2-yyyy1*1.142980502539901-yyyy2*0.412801598096189;    //Formula for highpass filter at 20Hz as given in slides
         zzzz = yyyy*0.391335772501769+yyyy1*-0.782671545003537+yyyy2*0.391335772501769-zzzz1*-0.369527377351241-zzzz2*0.195815712655833; // Formula for low pass filter at 40Hz instead of a Notch filter
         zzzz = abs(zzzz); //Rectify the signal