problem with ultrasonic toolbox for arduino
2 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
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:
0 个评论
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Arduino Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!