Help with State Transition Table
Mostrar comentarios más antiguos
Greetings, I am diong a project where I am creating an air piano inside simulink with my arduino uno board. The table is for lighting three LED lights based on different distance inputs from an ultrasound sensor. The output I am currently getting is that only my green LED lights up despite inputting several different distances. any help or tips would be greatly appreciated. I have also included a picture of my blocks diagram in simulink.


Respuesta aceptada
Más respuestas (1)
Fangjun Jiang
el 17 de Nov. de 2023
Editada: Fangjun Jiang
el 17 de Nov. de 2023
0 votos
[0<distance<10] is not the correct syntax. Your state stays at the default.
changing all to style [0<distance && distance<10] should resolve the issue.
2 comentarios
Fangjun Jiang
el 17 de Nov. de 2023
Editada: Fangjun Jiang
el 17 de Nov. de 2023
distance=35;
[0<distance<10]
This is equivalant to
(0<distance) < 10
madhan ravi
el 17 de Nov. de 2023
Editada: madhan ravi
el 17 de Nov. de 2023


yes, proper logical and should be used for stateflow conditions in the similar way done in MATLAB
Categorías
Más información sobre Modeling en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!