Compiling error for ' Led blinking ' program.

int ledPin=13;

void setup() 
{
  pinMode(ledPin,OUTPUT);
}

void loop() 
{
 digitalWrite(led,HIGH);
 delay(1000);
 digitalWrite(led,LOW);
 delay(1000);
}

And the compile error I got is: blink.c.ino: In function 'void loop()': blink.c.ino:10:15: error: 'led' was not declared in this scope blink.c.ino: In function 'void setup()': blink.c.ino:3:6: error: redefinition of 'void setup()' blink.c.ino:3:6: error: 'void setup()' previously defined here blink.c.ino: In function 'void loop()': blink.c.ino:8:6: error: redefinition of 'void loop()' blink.c.ino:8:6: error: 'void loop()' previously defined here Error compiling.

Also explain me why am i getting this.! :D

Because as the error told you, you have not defined “led”.

You did define “ledPin”.

It's usually the first error that is the real problem. One problem causes more.

aarg: It's usually the first error that is the real problem. One problem causes more.

It looks as if there are cumulative errors from successive passes through the compiler.

the lines with digitalWrite need to say ledPin, not led as you have put in.