Transfer problem

hello, I tried to transfer my code but it didn't work, here is my code

#include <Servo.h>
Servo monServo1;
Servo monServo2;
int bouton=2;
int angleMoteur;
void setup()
{
  monServo1.attach(5);
  pinMode(bouton,INPUT);
}
void loop()
{
  if(digitalRead(bouton)==HIGH)  {
    for(angleMoteur=0;angleMoteur<=90;angleMoteur=angleMoteur+1){
    monServo1.write(angleMoteur);
    delay(15);
  }
  for(angleMoteur=90;angleMoteur>0;angleMoteur=angleMoteur-1){
    monServo1.write(angleMoteur);
    monServo2.write(180-angleMoteur);
    delay(15);
  }
 }
}

I got the error:
Failed uploading: uploading error: exit status 1
it's a robobox code on an arduino nano

it is noted,

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x2f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x2f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x2f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x2f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x2f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x2f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x2f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x2f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x2f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x2f
Failed uploading: uploading error: exit status 1

Which NANO, which bootloader, real or clone, 368 or 168? I just got a bunch of NANO's and web=nt through that this morning. Use blink to determine what works and what doesn't. I got really unlucky in that the screw base has a flaw in it that confused me for a good hour.

Your code is not wrong. (side note: you are missing an "attach" for servo2)

Check that your USB cable is DATA/POWER and not just POWER
IDE >> TOOLS >> BOARD >> AVR BOARDS >> your board
IDE >> TOOLS >> PORT >> your port

Yes, it's a DATA/POWER

Which board?

Is this a classic Nano or one of the newer Nanos (Every, Nano 33, ...)?
For the classic Nano, there are three option under tools/processor; try all three.

Did the board work in the past?
Have you tried disconnecting everything?
Which servo are you using (specs are useful)? How is it powered?

Please enable verbose output during upload and disable verbose output during compilation under file/preferences in the IDE; upload the code and post the errors here (using code tags as you did earlier).


Your topic has been moved to a more suitable location on the forum.