MATLAB: No Add-On Library Uploaded to Board Arduino UNO

29 ビュー (過去 30 日間)
Garth Daniels
Garth Daniels 2021 年 11 月 30 日
コメント済み: Garth Daniels 2021 年 12 月 3 日
Hey guys.
So, I have no idea why this code isn't working, and I have a massive headache from it lol. Just trying to do the simple "Mapping Your Surroundings" kiddie project from Mathworks and the code simply won't work. I get the error message:
"No add-on library uploaded to the board. Clear and recreate the current arduino object to include the appropriate library. For a list of available libraries, type 'listArduinoLibraries'."
I have the Arduino Support Package installed. That's all I should need according to the guide, I believe. I changed the code to fit with the newest version, yet nothing. Help me out here haha, code:
a = arduino('COM3', 'Uno' , 'Libraries' , {'Ultrasonic' , 'Servo'} ) ;
ultrasonic = addon(a, 'Ultrasonic' , 'D12', 'D13' );
servo_motor = servo(a, 'D3');
That's all the code before it stops haha, no clue what's going on. Any help is appreciated!

採用された回答

Rohan Kale
Rohan Kale 2021 年 11 月 30 日
Hi Garth,
If you are using MATLAB version R2019a or beyond, the Ultrasonic library is already integrated with the support package and you can directly use the ultrasonic constructor to create Ultrasonic object -
>> u = ultrasonic(a, 'D12', 'D13'); % for R2019a or beyond
Refer to the ultrasonic documentation page at -
For versions R2018b or earlier, you will require to install the HC-SR04 addon-library from
and use the addon workflow to create the Ultrasonic addon object -
>> u = addon(a, 'JRodrigoTech/HCSR04', 'D12', 'D13'); % for R2018b or earlier
  1 件のコメント
Garth Daniels
Garth Daniels 2021 年 12 月 3 日
You're the best. This saved me lol, thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by