I get this error:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
When I upload this code to my Nano:
#include <Servo.h>
Servo myservo; int potpin = A0;int val;
void setup() {
myservo.attach(9);
}
void loop() {
val = analogRead(potpin);
val = map(val, 0, 1023, 0, 180);
myservo.write(val); delay(15);
}
The Arduino help center says I might have selected the wrong board and
port. So I reselected the Nano board and put in COM3. I also reinstalled
the CH340 driver as my Arduino is a clone. I’ve tried reuploading and
restarting but nothing seems to work and I get the same error.
Any help is much appreciated.