Warning: Unsuccessful read: A timeout occurred before the Terminator was reached..
4 views (last 30 days)
Show older comments
x1 = [];
x2 = [];
global s;
time=100;
i=1;
fopen(s)
while(i<time)
fprintf(s, 'Your serial data goes here')
out = fscanf(s);
Temp(i)=str2double(out(1:4));
% disp(Temp);
x1 = [x1 Temp(i)];
plot(handles.axes1,x1);
grid on;
xlabel(handles.axes1,'Time(seconds)');
ylabel(handles.axes1,'Temperature');
title(handles.axes1,'Real Time Temperature Graph');
pause(1)
grid;
Humi(i)=str2double(out(5:9));
% disp(Humi);
x2 = [x2 Humi(i)];
plot(handles.axes5,x2);
grid on;
xlabel(handles.axes5,'Time(seconds)');
ylabel(handles.axes5,'humi');
title(handles.axes5,'Real Time Humidity Graph');
pause(1)
set(handles.edit1,'String',num2str(Temp(i)));
set(handles.edit2,'String',num2str(Humi(i)));
drawnow;
i=i+1;
end
0 Comments
Answers (1)
See Also
Categories
Find more on Get Started with MATLAB 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!