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 MODSERIAL mbed
Fork of EMG by
Revision 23:7de28be57d75, committed 2016-10-28
- Comitter:
- daniQQue
- Date:
- Fri Oct 28 08:20:21 2016 +0000
- Parent:
- 22:10f62c4f88eb
- Commit message:
- hidscope test
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Oct 21 11:21:55 2016 +0000
+++ b/main.cpp Fri Oct 28 08:20:21 2016 +0000
@@ -1,6 +1,6 @@
#include "mbed.h"
#include "HIDScope.h"
-
+#include "MODSERIAL.h"
//Define objects
AnalogIn emg0( A0 );
AnalogIn emg1( A1 );
@@ -8,6 +8,7 @@
Ticker sample_timer;
HIDScope scope( 2 );
DigitalOut led(LED1);
+MODSERIAL pc(USBTX,USBRX);
/** Sample function
* this function samples the emg and sends it to HIDScope
@@ -23,6 +24,7 @@
scope.send();
/* To indicate that the function is working, the LED is toggled */
led = !led;
+ pc.printf("send\r\n");
}
int main()
@@ -30,8 +32,10 @@
/**Attach the 'sample' function to the timer 'sample_timer'.
* this ensures that 'sample' is executed every... 0.002 seconds = 500 Hz
*/
+
+ pc.baud(115200);
sample_timer.attach(&sample, 0.001);
-
+
/*empty loop, sample() is executed periodically*/
while(1) {}
}
\ No newline at end of file
