Cannot program Arduino Uno Board

172 次查看(过去 30 天)
Hi, I'm facing problem to connect my Arduino Uno board using MATLAB. I have search around the internet for around 7 hours and still cannot find the solution. I am really in big problem, I need to for my assignment. Can anyone help me please?
>> a = arduino();
Updating server code on board Uno (COM23). Please wait (might take a few minutes).
Cannot program board Uno (COM23). Please make sure the board is supported and the port and board type are
correct. For more information, see Arduino Hardware Troubleshooting.
I have tried changing the name of C:\User\user_name\Documents\Arduino file to other name but when I run the program again a new Arduino file is created in C:\User\user_name\Documents\.
  1 个评论
Liew Yean Choon
Liew Yean Choon 2018-6-19
this is my a = arduino('COM23','Uno','Trace',true)
"C:\Users\ACER\AppData\Local\Temp\ArduinoServer\MW\core\WInterrupts.c.o"
c:\programdata\matlab\supportpackages\r2017b\3p.instrset\arduinoide.instrset\arduino-1.8.1\hardware\tools\avr\bin\../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe:
unable to rename 'C:\Users\ACER\AppData\Local\Temp\ArduinoServer\MW\core\core.a'; reason: Permission
denied
Using library MWArduino in folder:
C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\arduinoide.instrset\arduino-1.8.1\libraries\MWArduino
(legacy)
Using library Wire at version 1.0 in folder:
C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\arduinoide.instrset\arduino-1.8.1\hardware\arduino\avr\libraries\Wire
Using library Servo at version 1.1.2 in folder:
C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\arduinoide.instrset\arduino-1.8.1\libraries\Servo
Using library SPI at version 1.0 in folder:
C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\arduinoide.instrset\arduino-1.8.1\hardware\arduino\avr\libraries\SPI
exit status 1

请先登录,再进行评论。

回答(7 个)

Rajat Ligade
Rajat Ligade 2020-4-11
I had Tx and Rx pins connected to something. I removed those pins and reran the code. the error is gone
  2 个评论
Bart Kieviet
Bart Kieviet 2021-10-4
This solved the above problem for me.
Mohd Hairi Mohd Zaman
This action solved my same issue too. After removing and reran the code, I reconnect those Tx & Rx pins again. No more error after that.

请先登录,再进行评论。


zhe cheng
zhe cheng 2019-4-18
change the port
it helps.

Menghan
Menghan 2018-6-19
Can you first confirm that the downloaded Arduino IDE works fine on your computer? To do that, go to the folder which is returned by typing "arduinoio.IDERoot" in MATLAB and then open the IDE manually. Try upload an empty sketch to the same board and see if you get the same error.
If yes, check if you have write permission to this folder C:\Users\ACER\AppData\Local\Temp\
  4 个评论
Rushabh Kalmate
Rushabh Kalmate 2021-12-6
i am facing exact same error , can you please tell me how it is solved ??
Rushabh Kalmate
Rushabh Kalmate 2021-12-6
After sucessesfull installation of support package for arduino hardware , i am facing problem for hardware setup . i have choosen usb cable type connection , After selecting correct board "uno" and port "COM7" and clicking on programme it is showing "First input can not be empty. Expected a non-empty character vector or a valid file-id."

请先登录,再进行评论。


Luis Delfin Puron
Luis Delfin Puron 2018-9-23
I was facing the same problem and solved it by setting the variable arduinoio.IDERoot to an address which current user has access to read and write. In my case it was: arduinoio.IDERoot = 'C:\\Program Files (x86)\\Arduino' Hope it helps.

Ogheneovo Idolor
Ogheneovo Idolor 2019-4-5
Try running MATLAB as Admin. Worked for me.

ybshokouhi
ybshokouhi 2020-1-30
I am having the same problem. Any updates on this?
  1 个评论
adrian paeckel
adrian paeckel 2020-3-29
I had the same problem. When trying to program my arduino mega 2560 on MATLAB I would see the Adruino IDE logo for a few moments before the error raised. The problem and solution I found is that I had installed an earlier version of the Arduino IDE on my Mac but the IDE contained in the Support Package on MATLB was an older one. So I replaced the old one, contained in the address which you get typing arduinoio.IDERoot in MATLAB command, for the latest one and it works fine now.

请先登录,再进行评论。


Andrew Loots
Andrew Loots 2020-7-22
I have Aduion Uno and it loads fine if I do not load the Paulstoffregen/One Wire library. As soon as I add the library it throws the' cannot program board " error.
Please help

类别

Help CenterFile Exchange 中查找有关 Arduino Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by