How to flash app.lamp object in App designer

30 vues (au cours des 30 derniers jours)
Achille Brice NOUBISSI
Achille Brice NOUBISSI le 18 Nov 2018
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!

Réponses (1)

Praveen Reddy
Praveen Reddy le 14 Mar 2023
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:

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by