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!