필터 지우기
필터 지우기

How do i display real-time water level in tank using serial readings (digital) from Arduino on Matlab GUI

조회 수: 1 (최근 30일)
Hello all, I need to read serial data continuously and display it on Matlab GUI. I want to build a simple GUI to display water level in tank. I need to know which things of the .m file need to be updated because I am new to Matlab and its GUI environment. Please help...
Thanks in advance
  댓글 수: 4
Iemad Sofi
Iemad Sofi 2019년 11월 9일
im sorry but i only know this lines of codes. i really need your help to teach me the codes. thankyou.
ps:
A is the maximum level of water. B is the minimum. i only need to display when the tank is max or min.
thanks again
Walter Roberson
Walter Roberson 2019년 11월 9일
You probably should not be doing the delete(handles.figure1) . You probably should not be using a second figure at all. The figure you show for gui_cuba.fig should be enough.
ax = axes(handles.axes1);
if ~isfield(handles, 'levelplot') || ~isvalid(handles.levelplot)
handles.levelplot = animatedline('Parent', ax);
title(ax, 'Water Level');
xlabel(ax, 'time (s)')
ylabel(ax, 'depth (furlongs)')
guidata(hObject, handles)
end
current_depth = appropriate value from parameter or from arduino
current_time = appropriate value from parameter or from arduino
addpoints(handles.levelplot, current_time, current_depth);

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by