problem with ultrasonic toolbox for arduino

조회 수: 2 (최근 30일)
ayoub indjaren
ayoub indjaren 2022년 3월 27일
Hi everyone, I'm facing this problem where i want to use the ultrasonic library in matlab for interfacing with arduino but it doesn't seem to work . I have searched around the internet for hours and still cannot find the solution. I am really gonna very grateful for any suggestion.
thanks.
this is the result i get
a = arduino('COM3', 'Uno', 'Libraries', 'JRodrigoTech/HCSR04')
Updating server code on board Uno (COM3). Please wait.
Cannot program board Uno (COM3). Please make sure the board is supported and the port and board type are correct.

답변 (2개)

Vidip
Vidip 2023년 11월 23일
I understand that you are facing an issue with programming the board or uploading the required code to the Arduino Uno. This could be due to several reasons like incorrect board type, incorrect COM port, for that you need to verify that the COM port specified in the ‘arduino’ function call (COM3 in this case) is the correct port to which the Arduino board is connected. You can check the COM port in the Arduino IDE or by using the ‘deviceinfo’ function in MATLAB.
You can go through the below documentation link to make sure you have established a proper connection between ultrasonic sensors and Arduino through MATLAB.
For further information, refer to the documentation link below:

MathWorks MATLAB Hardware Team
MathWorks MATLAB Hardware Team 2023년 11월 23일
Hi,
You can use the following code to work with Ultrasonic sensor
>> arduinoObj = arduino('<COM PORT>','Uno',"Libraries","Ultrasonic")
>> ultrasonicObj = ultrasonic(arduinoObj,'<TRIG Pin>','<ECHO Pin>')
Refer to this link to know more,
https://in.mathworks.com/help/supportpkg/arduinoio/ref/arduinoio.ultrasonic.html?msclkid=73d5c767ae5911ec9f90682f469bce0c
Feel free to contact MathWorks Technical Support to get help on resolving any errors.
https://www.mathworks.com/support/contact_us.html
Thanks,
MATLAB Hardware Team
MathWorks

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by