How to upload 2 libraries (Servo and Ultrasonic) to use Matlab with arduino
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Doug Leaffer
am 9 Apr. 2024
Beantwortet: Manikanta Aditya
am 17 Apr. 2024
a=arduino('/dev/cu.usbserial-14230','Nano3','Libraries','Servo') This code will work for the servos for the robot. This code includes the Com port for an Apple computer. I want to use the Ultrasonic Library in addition to the Servo Library, but can't get get it to work in the program. I have tried to add the library to the code above and I have tried to load the two libraries separately.
Has anyone been able to load multiple libraries?
2 Kommentare
Manikanta Aditya
am 10 Apr. 2024
Check this: Include 2 libraries in matlab - Using Arduino / Interfacing w/ Software on the Computer - Arduino Forum
Yes, you can load multiple libraries in MATLAB for use with Arduino. You can do this by including the names of the libraries in a cell array. Here is an example of how you can modify your code to include both the ‘Servo’ and ‘Ultrasonic’ libraries:
a = arduino('/dev/cu.usbserial-14230', 'Nano3', 'Libraries', {'Servo', 'Ultrasonic'});
Hope this helps!
Akzeptierte Antwort
Manikanta Aditya
am 17 Apr. 2024
Check this: Include 2 libraries in matlab - Using Arduino / Interfacing w/ Software on the Computer - Arduino Forum
Yes, you can load multiple libraries in MATLAB for use with Arduino. You can do this by including the names of the libraries in a cell array. Here is an example of how you can modify your code to include both the ‘Servo’ and ‘Ultrasonic’ libraries:
a = arduino('/dev/cu.usbserial-14230', 'Nano3', 'Libraries', {'Servo', 'Ultrasonic'});
Hope this helps!
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!