Help with upload

im trying to upload osme code but hwen i do i get this error

Sketch uses 2068 bytes (6%) of program storage space. Maximum is 32256 bytes.
Global variables use 50 bytes (2%) of dynamic memory, leaving 1998 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\Owner\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\Owner\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM4" -b115200 -D "-Uflash:w:C:\Users\Owner\AppData\Local\Temp\arduino\sketches\8AF8DD8975BDC29EAFA9784044C01123/Joystick_Servo_Control.ino.hex:i"

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\Owner\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM4
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200

avrdude: ser_open(): can't set com-state for "\.\COM4"

avrdude done. Thank you.

Failed uploading: uploading error: exit status 1

Is your Arduino connected to COM4? You can disconnect it and reconnect it and see which port disappears and reappears in the Tools->Port menu option.

Try the solution here: Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM serial port - #49 by ptillisch

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.