Question from the new guy

Ok so i'm just starting out with the arduino. I have a problem with an error popping up in the verify part.
Other parts of the code seem fine til it gets to my loop this is just a simple push button blink sketch.

const int red = 11;
const int switchPin = 2;

void setup() {
pinMode (red,OUTPUT);
pinMode (switchPin,INPUT);
}

void loop() {
for (digitalRead (switchPin) == HIGH) //here it give an error expected ';' before ')' token
{
digitalWrite(red,HIGH);
}
else
{
digitalWrite(red,LOW);
}
}

Programming languages are funny things - they have clearly defined syntax, and don't let you just make up your own. Try Googling "c for loop" to see what the real syntax is. You're not even close....

Regards,
Ray L.

You want an if statement there, not a for statement.

I see where it's the wrong statement now. Rookie mistake :confused:
Thank you