-
-
Save GiovanniBalestrieri/487589fa12173a913cd2 to your computer and use it in GitHub Desktop.
Snippet 1 - Matlab Arduino serial communication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% XBee expects the end of commands to be delineated by a carriage return. | |
xbee = serial(port,'baudrate',9600,'terminator','CR','tag','Quad'); | |
set(xbee, 'TimeOut', 5); %I am willing to wait 1.5 secs for data to arive | |
% I wanted to make my buffer only big enough to store one message | |
set(xbee, 'InputBufferSize', 390 ) | |
% Before you can write to your serial port, you need to open it: | |
fopen(xbee); | |
disp('Serial port opened'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment