Matlab connection via the serial port, to control the robot from there (interactively)
Revision 3:4fd668c1dbf5, committed 2016-11-01
- 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