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!