Help with State Transition Table
显示 更早的评论
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.


采纳的回答
更多回答(1 个)
Fangjun Jiang
2023-11-17
编辑:Fangjun Jiang
2023-11-17
0 个投票
[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 个评论
distance=35;
[0<distance<10]
This is equivalant to
(0<distance) < 10
madhan ravi
2023-11-17
编辑:madhan ravi
2023-11-17


yes, proper logical and should be used for stateflow conditions in the similar way done in MATLAB
类别
在 帮助中心 和 File Exchange 中查找有关 Modeling 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!