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
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
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
Tharun Kumar S 2013년 10월 26일
Hey Frederic, I gave up on this. However this might help you.
Hesham Hendy
Hesham Hendy 2015년 2월 10일
I hope if any one found anything post it please

댓글을 달려면 로그인하십시오.

aykut tamer
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

Hello Tamer , I cannot locate adioes.pde. Could please help me with that?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Arduino Hardware에 대해 자세히 알아보기

질문:

2013년 2월 22일

댓글:

2016년 5월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by