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: Encoder MODSERIAL mbed
Revision 1:5deb5092d487, committed 2013-11-05
- Comitter:
- jaccoton
- Date:
- Tue Nov 05 10:02:42 2013 +0000
- Parent:
- 0:ba744421930f
- Child:
- 2:4ae32e8863d5
- Commit message:
- emg dinges
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 05 09:21:38 2013 +0000
+++ b/main.cpp Tue Nov 05 10:02:42 2013 +0000
@@ -190,10 +190,10 @@
f1 = f;
f2 = f1;
- if (f<0.2)
+ if (f<0.1)
f=0;
else
- f=f;
+ f=f*3;
//pc.printf("%f \n \r",(s1*f));
@@ -212,10 +212,10 @@
xx2 = xx1;
ff1 = ff;
ff2 = ff1;
- if (ff<0.2)
+ if (ff<0.1)
ff=0;
else
- ff=ff;
+ ff=ff*3;
/* EMG Filter 3*/
xxx = emg2.read(); //Reading EMG value
yyy = 0.6389*xxx+1.2779*xxx1+0.6389*xxx2-yyy1*1.143-yyy2*0.4128; //Formula for highpass filter at 20Hz as given in slides
@@ -231,7 +231,7 @@
xxx2 = xxx1;
fff1 = fff;
fff2 = fff1;
- if (fff<0.2)
+ if (fff<0.1)
fff=0;
else
fff=fff;
@@ -250,7 +250,7 @@
xxxx2 = xxxx1;
ffff1 = ffff;
ffff2 = ffff1;
- if (ffff<0.2)
+ if (ffff<0.1)
ffff=0;
@@ -320,7 +320,7 @@
/* Read EMDG values, apply some math */
/* to get useful setpoint value */
/*setpoint = ((ff)-0.2255)*1226.55;*/ /* SHOUDER kan van -23 tot 79 graden draaien*/
- pc.printf("%f \n \r",f);
+ pc.printf("%f,%f \n \r",f,ff);
setpoint = (h1*1226.55); //emgPos moet wel tussen 0 en 1 zitte?
setpoint2 = (hh1*1226.55);
/*setpoint2 = (potmeter2.read())*1226,55; ELLEBOOG kan van 0 tot 102 graden draaien*/