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: MODSERIAL mbed Encoder
Revision 0:b13a317308d1, committed 2013-10-15
- Comitter:
- Socrates
- Date:
- Tue Oct 15 14:08:58 2013 +0000
- Child:
- 1:34202d107458
- Commit message:
- werkt niet
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MODSERIAL.lib Tue Oct 15 14:08:58 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/MODSERIAL/#b04ce87dc424
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Oct 15 14:08:58 2013 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "MODSERIAL.h"
+
+AnalogIn emg(PTB0);
+MODSERIAL pc(USBTX,USBRX);
+
+volatile bool looptimerflag;
+
+void setlooptimerflag(void)
+{
+ looptimerflag = true;
+}
+
+
+int main()
+{
+ Ticker looptimer;
+ looptimer.attach(setlooptimerflag,0.001);
+ float x,y,y1,x1,z1,yabs,z,yabs1;
+ //const float ts=0.001;
+ x1=0;
+ y1=0;
+ z1=0;
+ yabs1=0;
+ pc.baud(115200);
+
+ while(1) {
+ while(looptimerflag != true);
+ looptimerflag = false;
+ x=emg.read();
+ y=(y1/1.001-(0.9969/1.001)*x1+(0.9978565/1.001)*x);
+ yabs=abs(y);
+ z=(z1/1.001-(0.006244/1.001)*yabs1+(0.006238/1.001)*yabs);
+ pc.printf("%f\n\r",z);
+ x1=x;
+ y1=y;
+ z1=z;
+ yabs1=yabs;
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Oct 15 14:08:58 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file
