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

Dependencies:   MODSERIAL QEI

example.cpp

Committer:
jbrouwer
Date:
2016-11-01
Revision:
3:4fd668c1dbf5

File content as of revision 3:4fd668c1dbf5:

#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();
        }
    }
}