programming error-Need help on resolving it

Hi there!
Can someone kindly help me on the programing error as shown as follows-

#include <Servo.h>


Servo servo;
Servo servo1;
Servo servo2;
Servo servo3;
int angle = 20;
int angle1 = 70;
int angle2 = 20;
int angle3 = 70;


void setup() {
servo.attach(8 );
servo.write(angle);
servo1.attach(9);
servo1.write(angle1);
servo2.attach(10);
servo2.write(angle3);
servo3.attach(11);
servo3.write(angle3);

}




void loop()
{
for(angle3 = 90; angle3 > 70; angle3--) 
{ 
for(angle = 20; angle < 70; angle++)  
{
 for(angle1 = 70; angle1 > 20; angle1--)
 {                                  
  servo3.write(angle3);
  servo.write(angle);
  servo1.write(angle1);               
  delay(15);                   
 }
}
}
}




{
for(angle = 70; angle > 20; angle--); 
[u]{[/u]
for(angle1 = 20; angle < 90; angle1++);
{                              
 servo.write(angle);
 servo1.write(angle1);           
 delay(15);       
} 
}
}




{
[u]for(angle1 = 90; angle1 > 70; angle1--);[/u]
[u]{[/u]
for(angle2 = 20; angle2 < 70; angle++);
{
 for( angle3 = 70; angle2 < 20; angle--)
 {
  servo1.write(angle1);
  servo2.write(angle2);
  servo3.write(angle3);
  delay(15) 
 }
}
}
}




{
for(angle2 = 70; angle2 < 20; angle2--);
[u]{[/u]
[u]for(angle3 = 20; angle3 < 70; angle3++);[/u]
{
 servo2.write(angle2);
 servo3.write(angle3);
 delay(15)
}
}
}

It says expected unqualified Id before’{’ token and highlights the above underlined lines

Do you really want all those for loops to do nothing?
You have a lot of code that is not in a function, or that’s what it looks like to me.

Please remember to use code tags when posting code .

And remember to post the actual error messages.

Check for - Arduino Reference and look where any ; (semi-colons) are. You seem to have yours scattered about pretty much at random.

Steve

kshetragya:
It says expected unqualified Id before’{’ token and highlights the above underlined lines

You probably have mismatched braces but as you did not use the code button </> when posting your code it is not easy to check.

Code should look like this

…R

#include <Servo.h>


Servo servo;
Servo servo1;
Servo servo2;
Servo servo3;
int angle = 20;
int angle1 = 70;
int angle2 = 20;
int angle3 = 70;


void setup()
{
  servo.attach(8 );
  servo.write(angle);
  servo1.attach(9);
  servo1.write(angle1);
  servo2.attach(10);
  servo2.write(angle3);
  servo3.attach(11);
  servo3.write(angle3);
}




void loop()
{
  for (angle3 = 90; angle3 > 70; angle3--)
  {
    for (angle = 20; angle < 70; angle++)
    {
      for (angle1 = 70; angle1 > 20; angle1--)
      {
        servo3.write(angle3);
        servo.write(angle);
        servo1.write(angle1);
        delay(15);
      }
    }
  }
}




{
  for (angle = 70; angle > 20; angle--);
  {
    for (angle1 = 20; angle < 90; angle1++);
    {
      servo.write(angle);
      servo1.write(angle1);
      delay(15);
    }
  }
}




{
  for (angle1 = 90; angle1 > 70; angle1--);
  {
    for (angle2 = 20; angle2 < 70; angle++);
    {
      for ( angle3 = 70; angle2 < 20; angle--)
      {
        servo1.write(angle1);
        servo2.write(angle2);
        servo3.write(angle3);
        delay(15)
      }
    }
  }
}




{
  for (angle2 = 70; angle2 < 20; angle2--);
  {
    for (angle3 = 20; angle3 < 70; angle3++);
    {
      servo2.write(angle2);
      servo3.write(angle3);
      delay(15)
    }
  }
}

Auto formatting the code in the IDE (and removing the HTML underline tags) clearly shows up the code not in a function

UKHeliBob:
Auto formatting the code in the IDE (and removing the HTML underline tags) clearly shows up the code not in a function

…but doesn’t fix the problem of the excess semicolons.

but doesn’t fix the problem of the excess semicolons.

As you know, Auto format doesn’t fix anything but it can help show up some problems

The semicolons are not the only problem with the for loops

  for (angle2 = 70; angle2 < 20; angle2--);

Reading that as if it were a while loop, which is what it amounts to, gives
“set angle2 to 70 and and while it is less than 20 do stuff then decrement angle2”

Semicolon or not that is not going to do much