Servo script + magnet driver for biorobotics project in Uni. Made by Teun van der Molen

Dependencies:   MODSERIAL Servo mbed

Revision:
0:05ecf16dcb7b
Child:
1:26baa438620b
diff -r 000000000000 -r 05ecf16dcb7b main.cpp
--- /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