problem with ultrasonic toolbox for arduino

4 ビュー (過去 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 Center および File ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by