I am getting this error when I try to upload any sketch:
Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
Sketch uses 113398 bytes (44%) of program storage space. Maximum is 253952 bytes.
Global variables use 4124 bytes (50%) of dynamic memory, leaving 4068 bytes for local variables. Maximum is 8192 bytes.
avrdude: ser_open(): can't open device "\.\COM8": Access is denied.
avrdude: ser_drain(): read error: The handle is invalid.
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
the selected serial port avrdude: stk500v2_getsync(): timeout communicating with programmer
does not exist or your board is not connected
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I have made sure that device manager and the arduino IDE are set to the same serial port.
My IDE is set to the correct board.
I am using an elegoo mega clone.
The "Access is denied" error usually indicates that another application has the port open. A port can only be open in one application at a time so, if something else has it open, that will block the Arduino IDE from being able to upload to your board. If you have another application running that has the port open, tell it to close the port or exit the application, then try uploading again.
If that is not the case, try restarting your computer. Sometimes a glitch causes the port to get stuck open.
Connecting to programmer: .
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "S"; type = p
Software Version = V.w; Hardware Version = v.
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader
the selected serial port
does not exist or your board is not connected
avrdude done. Thank you.