I have been trying to upload a very simple script to my Arduiono Mega 2560 but I have been getting this error: [Enter error]
I tried using my fake Uno (yourDuino - got it in some set) and I got this error on Com10: avrdude: ser_open(): can't open device "\.\COM10": The system cannot find the file specified.
Unplugged Mega and ran code on fake Uno, got this: avrdude: ser_open(): can't open device "\.\COM3": Access is denied.
I have tried changing the ports on both devices - doesn't work.
I have been trying to get this working for ages, does anyone know how to fix it?
Code (I doubt there is anything wrong with it):
#define buzzerPort 13
int secondsToLaunch = 30;
void setup() {
// put your setup code here, to run once:
pinMode(buzzerPort, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
for(int i = 0; i <= secondsToLaunch; i++) {
digitalWrite(buzzerPort, HIGH);
delay(100);
digitalWrite(buzzerPort, LOW);
delay(900);
}
}
the official MEGA board does not need a driver on most computers
assuming you are using Windows, if you plug and unplug the board, do you see it appearing in the com ports?
and you selected MEGA as your target board before trying to upload?
go to preferences, set everything in verbose mode
make sure no serial monitor is open
try to compile (for Arduino MEGA) and upload (to the right selected Serial port) the following code
void setup() {}
void loop() {}
copy and paste what you see in the compilation window (under the code)
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\User\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM3
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_open(): can't open device "\\.\COM3": Access is denied.
avrdude done. Thank you.
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
I’m no windows expert… so can’t help more. You would t need to find out what takes over the serial port (limited permissions, antivirus, virus on your pc,.…)
Run the code without the Arduino plugged in multiple times
Plug Arduino back in
Run code!
Another Edit: I have to redo the above steps every time I want to run the code. The blink code doesn't work on my Mega, the LED just stays on the whole time, no blinking, its connected to pin 13.
One more edit (I can't create new reply's because my account it too new):
I left my Arduino plugged in to my pc with the blink script uploaded for a while. Most of that time the LED stayed on, but after a while it started blinking!
Two things:
I just uploaded the blink again script without errors.
My old script gave me errors with uploading, LED is constantly on.
On no
Update: Original Script now works if you use the steps above every time you want to run it.
Another Update: Can't open Serial Monitor + LED only complies with the script for a few seconds, then goes back to always on.
Yet another update: Moved to my old MacBook for my Arduino Coding - windows is stupid.