EMG+filter

Dependencies:   mbed HIDScope biquadFilter biquad

Committer:
vsluiter
Date:
Fri May 31 08:33:42 2013 +0000
Revision:
2:e314bb3b2d99
Parent:
1:db54d9412d18
Child:
3:1296e996026a
Now really at 1ms

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vsluiter 0:32bb76391d89 1 #include "mbed.h"
vsluiter 0:32bb76391d89 2
vsluiter 2:e314bb3b2d99 3 //Classes
ArvidKeemink 1:db54d9412d18 4 AnalogIn emg0(PTB0); //Analog input
ArvidKeemink 1:db54d9412d18 5 PwmOut red(LED_RED); //PWM output
vsluiter 2:e314bb3b2d99 6 Ticker timer;
vsluiter 2:e314bb3b2d99 7 Serial pc(USBTX,USBRX);
vsluiter 2:e314bb3b2d99 8
vsluiter 2:e314bb3b2d99 9 //Functions
vsluiter 2:e314bb3b2d99 10 void looper()
vsluiter 2:e314bb3b2d99 11 {
vsluiter 2:e314bb3b2d99 12 float emg_value;
vsluiter 2:e314bb3b2d99 13 red = emg_value = emg0;
vsluiter 2:e314bb3b2d99 14 pc.printf("%.6f\n",emg_value);
vsluiter 2:e314bb3b2d99 15 }
vsluiter 0:32bb76391d89 16
vsluiter 0:32bb76391d89 17 int main()
vsluiter 0:32bb76391d89 18 {
vsluiter 2:e314bb3b2d99 19 pc.baud(115200);
vsluiter 2:e314bb3b2d99 20 red.period_ms(2);
vsluiter 2:e314bb3b2d99 21 timer.attach(looper, 0.001);
ArvidKeemink 1:db54d9412d18 22 while(1) //Loop
vsluiter 0:32bb76391d89 23 {
vsluiter 2:e314bb3b2d99 24
vsluiter 0:32bb76391d89 25
vsluiter 0:32bb76391d89 26 }
vsluiter 0:32bb76391d89 27 }