Matlab connection via the serial port, to control the robot from there (interactively)

Dependencies:   MODSERIAL QEI

Files at this revision

API Documentation at this revision

Comitter:
jbrouwer
Date:
Tue Nov 01 02:36:29 2016 +0000
Parent:
2:5de7be1a34dc
Commit message:
Added example code

Changed in this revision

example.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example.cpp	Tue Nov 01 02:36:29 2016 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "MatlabComm.h"
+
+MatlabComm MyComm(D4, D5, D12, D13);
+
+Ticker MyTest;
+
+double test_rate = 0.01;
+
+
+bool flag1 = false;
+void test(){
+    flag1=true;
+}
+
+int main()
+{
+    MyTest.attach(&test, test_rate);
+    while (true) {
+        if (flag1){
+            flag1=false;
+            MyComm.Step();
+        }
+    }
+}
\ No newline at end of file