Programatically configure arduino in standalone application

조회 수: 5 (최근 30일)
David Wilby
David Wilby 2021년 11월 17일
편집: David Wilby 2022년 1월 6일
Hi,
In a standalone application which uses the Arduino Hardware Support Package, on connecting to the arduino, the "Configure Arduino" dialog is launched, asking the user to specify port, board and path to the ardunio IDE.
Is there a way to programmatically bypass this manual config step?
Thanks

채택된 답변

Kshitij Chhabra
Kshitij Chhabra 2021년 12월 27일
Hi,
For a clean installation, the IDE Path should be automatically configured when you install the Arduino Support Package. You can check the following MATLAB Answer to debug probable causes.
Additionally, the path can be set by the following command
arduinoio.IDERoot = 'Link To Path'
Hope it helps!
  댓글 수: 1
David Wilby
David Wilby 2022년 1월 6일
편집: David Wilby 2022년 1월 6일
Thanks Kshitij, this didn't completely solve the problem for me but it lead me in the right direction. This is because I'm specifically referring to a deployed application, i.e. isdeployed returns true.
In this case I've found by digging into the arduino class, that you can specify the port and board name, along with the arduino IDE path when instantiating, and this will configure the arduino connection and prevent the 'Configure...' dialog from being presented to the user (which was the undesirable part for me in this case).
for example:
a = arduino('COM4', 'Uno', 'ArduinoIDEPath', 'C:\Program Files\arduino-1.8.16')
The ArduinoIDEPath Name-Value pair is not documented here (https://uk.mathworks.com/help/supportpkg/arduinoio/ref/arduino.html#namevaluepairarguments), but can be found in the source code.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by