필터 지우기
필터 지우기

how to display value from arduino then display in the app design

조회 수: 1 (최근 30일)
Imam Pratama Setiady
Imam Pratama Setiady 2021년 7월 26일
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개)

카테고리

Help CenterFile Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by