how to display value from arduino then display in the app design
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Instrument Control Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!