How to output to GUI window?
Show older comments
I am getting Voltage values from Arduino that I would like to display on a GUI window. All I am looking for is a window that displays "Voltage = whatever it is at that instance" Can't seem to figure it out. Any help is appreciated.
I have the following;
a=arduino();
interv=10000;
time=1;
t=0;
%
while (time<interv)
time=time+1;
Voltage=readVoltage(a,'A0');
%
if Voltage > 1
disp(Voltage);
end
drawnow
end
1 Comment
Walter Roberson
on 27 Jul 2018
The disp() should work, provided that the Voltage is greater than 1. You will not need drawnow. And you are missing an 'end'
It might make more sense to use a "for" than a "while"
Accepted Answer
More Answers (0)
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!