Hello. I have 1 or 0 Signal coming as a input from my Ultrasonic Sensor. I want to make a Timer in simulink so that, if my input is 1 continuous for 5 seconds ,it gives me 1 at end, if not the timer starts again ,when 1 comes from the Sensor. I have Speed of Car and my distance. I wanted to integrate the distance to get time. Thankyou so much.

2 个评论

You can use Timer APIs to access timers programatically. Here's a link to the documentation.
Thankyou so much:)

请先登录,再进行评论。

 采纳的回答

Fangjun Jiang
Fangjun Jiang 2023-6-28

1 个投票

It might be easier to implement it through Simulinnk block diagram, similar to this one.

1 个评论

Thankyou. I also used Integrator (Discrete) with reset to 0, if the conditon doesnot match and if condition match then compare to 10 for 10 seconds.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Simulink 的更多信息

产品

版本

R2023a

标签

Community Treasure Hunt

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

Start Hunting!

Translated by