![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Servo script + magnet driver for biorobotics project in Uni. Made by Teun van der Molen
Dependencies: MODSERIAL Servo mbed
Diff: main.cpp
- Revision:
- 0:05ecf16dcb7b
- Child:
- 1:26baa438620b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Sep 09 15:19:24 2015 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "HIDScope.h" + +// Define the HIDScope and Ticker object +HIDScope scope(1); +Ticker scopeTimer; + +// Read the analog input +AnalogIn an_in(A0); + +// The data read and send function +void scopeSend() +{ + scope.set(0,an_in.read()); + scope.send(); +} + +int main() +{ + // Attach the data read and send function at 100 Hz + scopeTimer.attach_us(&scopeSend, 1e4); + + while(1) { } +} \ No newline at end of file