Skip to content

Instantly share code, notes, and snippets.

@GiovanniBalestrieri
Last active August 29, 2015 14:26
Show Gist options
  • Save GiovanniBalestrieri/51ecc74f418feb10e953 to your computer and use it in GitHub Desktop.
Save GiovanniBalestrieri/51ecc74f418feb10e953 to your computer and use it in GitHub Desktop.
Snippet 3 - Rolling Plot Matlab Arduino Gyroscope
while (abs(Wz) < 2500)
fprintf(xbee,'M') ;
notArrived = false;
try
while (get(xbee, 'BytesAvailable')~=0 && ~notArrived)
% read until terminator
sentence = fscanf( xbee, '%s'); % this reads in as a string (until a terminater is reached)
if (strcmp(sentence(1,1),'A'))
notArrived = true;
%% store and plot
end
end
catch exeption
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment