working version but stripped of most unnecessary code like print statements
Dependencies: HIDScope MODSERIAL biquadFilter mbed FastPWM QEI
Revision 2:e314bb3b2d99, committed 2013-05-31
- Comitter:
- vsluiter
- Date:
- Fri May 31 08:33:42 2013 +0000
- Parent:
- 1:db54d9412d18
- Child:
- 3:1296e996026a
- Commit message:
- Now really at 1ms
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu May 23 13:33:19 2013 +0000 +++ b/main.cpp Fri May 31 08:33:42 2013 +0000 @@ -1,14 +1,27 @@ #include "mbed.h" +//Classes AnalogIn emg0(PTB0); //Analog input PwmOut red(LED_RED); //PWM output +Ticker timer; +Serial pc(USBTX,USBRX); + +//Functions +void looper() +{ + float emg_value; + red = emg_value = emg0; + pc.printf("%.6f\n",emg_value); +} int main() { + pc.baud(115200); + red.period_ms(2); + timer.attach(looper, 0.001); while(1) //Loop { - red = emg0; - wait(0.01); //Looptime (approx) + } } \ No newline at end of file