How do I solve this problem? (avrdude)

Hello I am new to arduino and with my animatronic hand code below I am having an issue (error msg below):

#include <Servo.h>

Servo servo1;
Servo servo2;
Servo servo3;

int a=A0;
int b=A1;
int c=A2;
void setup() {
  servo1.attach(9);
  servo2.attach(10);
  servo3.attach(11);
  
  servo1.write(0);
  servo2.write(0);
  servo3.write(0);
  
  Serial.begin(9600);
  
  }

void loop() {
  // put your main code here, to run repeatedly:

int val1=analogRead(a);
int val2=analogRead(b);
int val3=analogRead(c);

if (val1<40)
{
  servo1.write(180);
  delay(3)  ;

}

if (val1>200)
{
  servo1.write(0);
  delay(3)  ;

}

if (val2<40)
{
  servo1.write(180);
  delay(3)  ;

}

if (val2>200)
{
  servo1.write(0);
  delay(3)  ;

}

if (val3<40)
{
  servo1.write(180);
  delay(3)  ;

}


if (val3<200)
{
  servo1.write(0);
  delay(3)  ;

}


}

I am getting this error message:

Sketch uses 3224 bytes (9%) of program storage space. Maximum is 32256 bytes.
Global variables use 231 bytes (11%) of dynamic memory, leaving 1817 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified.


Problem uploading to board.  See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.

I have tried using Device Manager and it does not work - same goes for going to Tools -> Port (Port doesn't open)

I am new to the community and would like to know how to solve this and I am genuinely sorry if I have made a mistake in the way I have uploaded this.

Side note - I am using Windows 10 on the older Surface

What Arduino? (looks like Uno/Nano, based on memory available, but...)
When you plug/unplug the Arduino, do you get the usual "honk" from Windows?

Is it possible you have the Serial monitor open in another instance ?

Close the IDE, (use File->Quit ) remove the Arduino from USB, reboot.

Open the IDE (just once only have a single instance open !)
Check Tools-> port
Now Plug in the Arduino, and check Tools->Port again, it should have appeared as a port by now.
Then upload.

yes

I have tried such a thing
it doesn't work

and?

Sorry I use an uno (i get the honk)

In that case, i suggest you uninstall the IDE and re-install it again. It is either a USB issue, (have you tried a different cable ?) or an error in the IDE installation.

I have been using the IDE that is currently on my computer for a few months now, same goes for the cable but, I will still re-install and check the cable. I could also use other ways in case it doesn't work. Thank you!

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