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.