The reason for this error is you still have the port from the Uno selected. The 3D printer control board has a different COM port. You need to select that port from the Arduino IDE's Tools > Port menu before uploading.
If you don’t know which port is your 3d printer board, you can find it like this:
- Unplug your 3D printer's USB cable from the computer.
- Tools > Port
- Note the ports, if any, listed in the menu.
- Close the Tools menu. The ports list is only updated when the Tools menu is re-opened, so this step is essential.
- Plug your 3D printer's USB cable back into the computer.
- Tools > Port - The new port listed in the menu is your 3D printer board.
so i unplugged it, no ports listed, closed the tools menu, plugged it back in, said com4, hit upload and
Arduino: 1.8.13 (Windows 10), Board: "Sanguino, ATmega1284 or ATmega1284P (16 MHz)"
Sketch uses 125530 bytes (96%) of program storage space. Maximum is 130048 bytes.
Global variables use 6297 bytes (38%) of dynamic memory, leaving 10087 bytes for local variables. Maximum is 16384 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega1284p -carduino -PCOM4 -b115200 -D -Uflash:w:C:\Users\irish\AppData\Local\Temp\arduino_build_258346/Marlin.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:\Program Files (x86)\Arduino\hardware\tools\avr/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.
An error occurred while uploading the sketch
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.