Code Failing to upload on a (official) Uno

every time I try to upload a very simple code to my board it comes up with the error messsage

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Haupt Family\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Haupt Family\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Haupt Family\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10809 -build-path C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209 -warnings=none -build-cache C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_cache_135345 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Fade\Fade.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Haupt Family\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Haupt Family\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Haupt Family\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10809 -build-path C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209 -warnings=none -build-cache C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_cache_135345 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Fade\Fade.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209\sketch\Fade.ino.cpp" -o nul
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209\sketch\Fade.ino.cpp" -o "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209\sketch\Fade.ino.cpp" -o "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209\sketch\Fade.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_cache_135345\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a
Linking everything together...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209/Fade.ino.elf" "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209\sketch\Fade.ino.cpp.o" "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209/..\arduino_cache_135345\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209" -lm
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209/Fade.ino.elf" "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209/Fade.ino.eep"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -R .eeprom "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209/Fade.ino.elf" "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209/Fade.ino.hex"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-size" -A "C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209/Fade.ino.elf"
Sketch uses 1152 bytes (3%) of program storage space. Maximum is 32256 bytes.
Global variables use 13 bytes (0%) of dynamic memory, leaving 2035 bytes for local variables. Maximum is 2048 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM4 -b115200 -D -Uflash:w:C:\Users\HAUPTF~1\AppData\Local\Temp\arduino_build_422209/Fade.ino.hex:i

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM4
Using Programmer : arduino
Overriding Baud Rate : 115200
An error occurred while uploading the sketch
avrdude: ser_open(): can't set com-state for "\.\COM4"

avrdude done. Thank you.

i have tryed 2 different boards, HELP!

Make sure you have selected the port of your Arduino board from the Tools > Port menu.

Sometimes the port will be labeled with the board name in the menu. Other times it will not. If you don’t know which port is your Arduino, you can find it like this:

  • Unplug your Arduino board from the computer.
  • Tools > Port
  • Note the ports, if any, listed in the menu.
  • Close the Tools menu
  • Plug your Arduino board into the computer.
  • Tools > Port - The new port listed in the menu is your Arduino board.

already done that
it shows connected and ready to receive code

See attachment for a screenshot of the connection details

Try restarting your computer. Sometimes a glitch will cause a COM port to get stuck in an unusable state. Restarting the computer will fix that.

done that to

Is there a way to clear it before uploading a new code?

I think it came with the blink code pre-installed, because the L (pin13) light is flashing

The previous sketch is automatically replaced when you upload a new sketch. There is no need to take any action to remove it.

If it's the quick triple blink pattern, that's the bootloader indicating that it's running and ready to receive a sketch. But often boards ship with blink preinstalled as a diagnostic aid.

unable to set com-state is a problem in communication with the USB-serial adapter - it's not even getting to the point where it's talking to the microcontroller you're trying to program.

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

Occasional seen on USB 3.0 ports.
Almost certainly worth trying on a USB 2.0 port or another computer.

Also seen when another program is locking down a com port waiting for coms to become active.
Ensure no other programs are trying to read from the COM ports before trying to upload.

Bob.

I’m not sure my computer has a usb 2.0 port

And if I did how can I find out what port it is

I have a docking station would that have the correct port on it?

I have also tried 2 different cables so there is not a problem with transferring the data

I have a dell latitude e7250 with intel core i7 vPro, 8GB of RAM and Microsoft Windows 10 2018

OK yours has only USB 3.0 ports.
The docking station is also USB 3.0 only

If you have an older USB 2.0 hub (preferably powered) you might want to try inserting that between the laptops USB port and the Arduino.
If it helps in any way then you are one of the few that has USB 3.0 issues.

Ensure the USB drivers are DIRECTLY from Dell and not Microsoft.
If they are Microsoft's you may want to visit the dell site and get theirs and replace the Microsoft ones.

Bob.

ok found a USB 2.0 hub,
going to bed soon but will check tomorrow
Thanks

ok I can upload a program to the board and the light stops blinking, but anything that i connect to the pins that are connected to a breadboard isn't working

Well thats a step ahead by the sounds of it.

Is that using the hub or directly connected to the lappy. ?

A pic of how you are connecting things to the breadboard and what pins you are using might be useful here.

Or even a simple schematic.

Bob.

that's connected the laptop

the code and the diagram with connection and Schematic details are on this link

SO you are saying your LCD does not work ?

Check the schematic carefully against your LCD screen wiring.
They are pretty much all the same but there are one or two out there where pins may be swapped over.

My very first LCD some years ago was one such. Wasn't until I carefully checked that I found the mistake.

Also breadboards can on occasion be slightly out causing a missed connection.
Double check each connection with a multimeter for continuity with the Arduino powered down.
If you are using DUPONT cables they too can on occasion go bad so check those too.
DO NOT push stranded wire into a breadboard as that can be a recipe for disaster instead make sure any stranded wire is tinned before use.

Bob.