How to flash app.lamp object in App designer

조회 수: 10 (최근 30일)
Achille Brice NOUBISSI
Achille Brice NOUBISSI 2018년 11월 18일
답변: Praveen Reddy 2023년 3월 14일
Hi everybody,
I'm doing project with arduino and I want to use app designer to flash a led and app.lamp object at the same time, transmit and receive data by USB port and trace this data from a sensor.
It's my first time I'm going to use App designer and would like to know at first how to flash app.lamp object.
If you have links to examples that can help me understand app designer do not hesitate to send them.
Thank you!

답변 (1개)

Praveen Reddy
Praveen Reddy 2023년 3월 14일
Hi Achille,
I understand that you want to change the operational state of lamp object. You can use “Enable” property to on/off the lamp. Attaching a small code for your reference.
%Call Back function of a switch component
function SwitchValueChanged(app, event)
value_S2 = app.Switch.Value;
if strcmp(value_S2,'On')
app.Lamp.Enable='on';
else
app.Lamp.Enable='off';
end
end
Please refer to the MATLAB Documentation to know more:

카테고리

Help CenterFile 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!

Translated by