HC-SR04 Ultrasonics sensor - ArduinoIO package
显示 更早的评论
Hi, I need to measure the distance using the HC-SR04 ultrasonic sensor with the help of simulink (arduinoIO package or arduino target). It is really hard because in arduino IDE i can use the pulsein() function which would give me the elapsed time of the echo signal and fire pulses for the trigger pin too. So is there a way to do this in simulink?
Can I make my own simulink block for this sensor interface using S-function and place it in my ArduinoIO library?
回答(3 个)
Marco Souza
2015-11-25
1 个投票
Guys, you justo gotta code on the adioes.pde I just used the function analog read, which i wouldnt use for my project, and replaced it with my hcsr04 basic code. Then, my analog read block gives me the distance measured on my ultrasonic sensor via code on the firmware. Did u get it?
Frederic
2013-10-25
0 个投票
Hi Tharun - did you manage to do this? - I am facing the same problem... Actually, I don't even see the ping back, coudl you share your base Simulink model? Thanks!
2 个评论
Tharun Kumar S
2013-10-26
Hesham Hendy
2015-2-10
I hope if any one found anything post it please
aykut tamer
2016-1-5
0 个投票
Hello Marco, i have the same problem. Can you share with me that which part did you replace on adioes.pde ?
1 个评论
puneet puneet
2016-5-2
Hello Tamer , I cannot locate adioes.pde. Could please help me with that?
类别
在 帮助中心 和 File Exchange 中查找有关 Arduino Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!