NMLAB
/
MbedMATLABlink
for binary scan
main.cpp
- Committer:
- Dzak
- Date:
- 2015-05-08
- Revision:
- 0:c2886e9735cc
File content as of revision 0:c2886e9735cc:
#include "mbed.h" #include "USBSerial.h" USBSerial MATLAB; int main() { -15351 long tester_X = 5; long tester_Y = -5; long tester_Read = 2500; char L_X, H_X, L_Y, H_Y, L_Z, H_Z, L_Read, H_Read; while(1) { H_X = (char)((tester_X & 0xFFFF) >> 8); L_X = (char)(tester_X & 0xFFFF); H_Y = (char)((tester_Y & 0xFFFF) >> 8); L_Y = (char)(tester_Y & 0xFFFF); H_Read = (char)((tester_Read & 0xFFFF) >> 8); L_Read = (char)(tester_Read & 0xFFFF); wait(0.5); MATLAB.putc(H_X); wait(0.1); MATLAB.putc(L_X); wait(0.1); MATLAB.putc(H_Y); wait(0.1); MATLAB.putc(L_Y); wait(0.1); MATLAB.putc(H_Read); wait(0.1); MATLAB.putc(L_Read); wait(0.1); } }