how can create Changing lamp color with start and stop button
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Amir Azadeh Ranjbar
le 21 Avr 2022
Réponse apportée : Amir Azadeh Ranjbar
le 6 Mai 2022
0 commentaires
Réponse acceptée
Geoff Hayes
le 21 Avr 2022
@Amir Azadeh Ranjbar - you would need callback functions for your start and stop buttons. These callbacks would then change the colour of the lamp. Something like the following may work:
% Button pushed function: StartButton
function StartButtonPushed(app, event)
app.Lamp.Color = 'b'; % blue
end
% Button pushed function: StopButton
function StopButtonPushed(app, event)
app.Lamp.Color = 'r'; % red
end
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps 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!