how to display value from arduino then display in the app design
조회 수: 2 (최근 30일)
이전 댓글 표시
i have some a question, if i want to display the result detection of arduino in the app design. how to get all the data then to display and what the syntax
this is my code for communication serial app design with arduino
properties (Access = private)
% Serial Connections
serial
% Description of color
GREEN_COLOR = 'GREEN' %[0 1 0]
RED_COLOR = 'RED' %[1 0 0]
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: Connect
function ConnectButtonPushed(app, event)
app.serial = serial(app.PortList.Value);
fopen(app.serial);
app.ConnLamp.Color = app.GREEN_COLOR;
end
% Button pushed function: Disconnect
function DisconnectButtonPushed(app, event)
stopasync(app.serial)
fclose(app.serial);
app.ConnLamp.Color = app.RED_COLOR;
end
% Button pushed function: Refresh
function RefreshButtonPushed(app, event)
if license('test', 'instr_control_toolbox')
delete(instrfind);
p = instrhwinfo('serial');
app.PortList.Items = p.AvailableSerialPorts;
end
end
end
this the input of arduino
float value_temperature;
float voltage_ph;
float value_ph;
float voltage_turbidity;
float value_NTU;
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!