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: FastPWM HIDScope MODSERIAL QEI biquadFilter mbed
Diff: main.cpp
- Revision:
- 18:21d8e7a81cf5
- Parent:
- 16:9f7797ffd0fb
- Child:
- 19:2bf824669684
diff -r 290d0b765a96 -r 21d8e7a81cf5 main.cpp
--- a/main.cpp Tue Sep 22 07:00:54 2015 +0000
+++ b/main.cpp Thu Sep 22 08:04:14 2016 +0000
@@ -5,6 +5,7 @@
AnalogIn emg(A0); //Analog input
Ticker sample_timer;
HIDScope scope(1);
+DigitalOut led(LED1);
/** Sample function
* this function samples the emg and sends it to HIDScope
@@ -18,14 +19,16 @@
/* Repeat the step above if required for more channels (channel 0 up to 5 = 6 channels) */
/* Finally, send all channels to the PC at once */
scope.send();
+ /* To indicate that the function is working, the LED is toggled */
+ led = !led;
}
int main()
{
/**Attach the 'sample' function to the timer 'sample_timer'.
- * this ensures that 'sample' is executed every... 0.002 seconds
+ * this ensures that 'sample' is executed every... 0.01 seconds
*/
- sample_timer.attach(&sample, 0.002);
+ sample_timer.attach(&sample, 0.01);
/*empty loop, sample() is executed periodically*/
while(1) {}