Error : Serial does not name a type

error: 'Serial' does not name a type
this is my code for servo motor control. and i can not use the monitor to check the angle of the motor.
what is wrong ? how can i fix it ?

#include <Servo.h>
int p;
Servo s1;
Servo s2;
Serial.bigin(9600);
void setup()
{
s1.attach(1);
s2.attach(2);

}

void loop()
{
int p;
for(p=0;p<=180;p=p+1)
{
s1.write(p);
delay(25);
}
for(p=180;p>=0;p=p-1)
{
s1.write(p);
delay(25);
}
Serial.println(p);
}

alexgert:
what is wrong ? how can i fix it ?

for a start don't hijack someone else's thread
then you have a wrong formatting of your code
--> read forum rules and messages at the top of the forum. that will get you started.

PS:
Serial.begin() needs to be in the setup() and bigin() does not exist...

Topic split

Do not hijack topics

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Serial.bigin(9600);

Spelling error and in the wrong part of your code.

Tom... :slight_smile:

Also, don't use pin 1.
Serial had dibs on it

The Serial.println(p); line is always going to print the same value. It really won't help with debugging.

void loop()
{
  int p;
  for (p = 0; p <= 180; p = p + 1)
  {
    s1.write(p);
    delay(25);
  }
  for (p = 180; p >= 0; p = p - 1)
  {
    s1.write(p);
    delay(25);
  }
  Serial.println(p);
}