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: HIDScope biquadFilter mbed
Fork of EMG by
Diff: main.cpp
- Revision:
- 11:ce72ec658a95
- Parent:
- 10:09b8424a7b39
- Child:
- 13:18d4cef1fdb4
diff -r 09b8424a7b39 -r ce72ec658a95 main.cpp
--- a/main.cpp Wed Sep 10 09:11:30 2014 +0000
+++ b/main.cpp Thu Sep 11 07:16:24 2014 +0000
@@ -1,11 +1,13 @@
#include "mbed.h"
#include "MODSERIAL.h"
+#include "HIDScope.h"
//Define objects
AnalogIn emg0(PTB1); //Analog input
PwmOut red(LED_RED); //PWM output
Ticker log_timer;
MODSERIAL pc(USBTX,USBRX);
+HIDScope scope(2);
/** Looper function
* functions used for Ticker and Timeout should be of type void <name>(void)
@@ -30,6 +32,9 @@
/*send value to PC. Line below is used to prevent buffer overrun */
if(pc.rxBufferGetSize(0)-pc.rxBufferGetCount() > 30)
pc.printf("%u\n",emg_value);
+ scope.set(0,emg_value);
+ scope.set(1,red.read());
+ scope.send();
/**When not using the LED, the above could also have been done this way:
* pc.printf("%u\n", emg0.read_u16());
*/
