fscanf question with Arduino
Show older comments
I need to know how I can control the amount of Serial.println(variable_1) methods that get read during the fscanf() execution.
This is the code:
arduino = serial('COM4');
fopen(arduino);
x = 1:1:60;
for i=1:length(x)
y(i) = fscanf(arduino, '%d');
end
fclose(arduino);
% Plot data from arduino
plot(x,y)
If my Arduino sketch has multiple Serial.println() it seems to combine the variables within the Serial statements in the same vector. Is it possible for them to be separated?
Accepted Answer
More Answers (1)
Kristian Cvetkov
on 12 Nov 2017
0 votes
How I can write data on my Arduino, after I read them in Matlab?
Categories
Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!