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

29 visualizaciones (últimos 30 días)
Garth Daniels
Garth Daniels el 30 de Nov. de 2021
Comentada: Garth Daniels el 3 de Dic. de 2021
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!

Respuesta aceptada

Rohan Kale
Rohan Kale el 30 de Nov. de 2021
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

Más respuestas (0)

Categorías

Más información sobre MATLAB Support Package for Arduino Hardware en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by