Losing my rag now..

Hi all

I am using windows 7 with Arduino software version 1.0.5.
Is it me just being a newbee or is it a bug in the software?, sometimes when I type within a void loop, matters not how I type the syntax it will not be recognised by the ide.

And I have even copied and pasted from the tutorial site mand it has worked even though my txt has been identical to the copy and pasted txt.

EG

}
if(LDRValue < Light_sensitivity)
{

I get a" Light_dependant_resistor:18: error: expected unqualified-id before if"

Please tell me what I am doing wrong when I type my txt.

Thanks

Don

You need to post your code.
Between code tags, please.

Sorry.

int LDR = 0;
int LDRValue = 0;
int light_sensitivity = 500;


void setup()
{
    Serial.begin(9600);
    pinMode(13, OUTPUT);
}

void loop()
{
  LDRValue = analogRead(LDR);
  Serial.println(LDRValue);
  delay(50);
}
  if(LDRValue < Light_sensitivity)
  {
    digitalWrite(13, HIGH);
  }
    else
   {
    digitalWrite(13,LOW);
   }
}

Is that better??

Get rid of the closing brace before the if statement.

Pete

C is case-sensitive; "light_sensitivity" is not the same as "Light_sensitivity"

You mean it gives exactly the same error or it still doesn't compile?
Show the error message.

Pete

Thanks AWOL. :blush:

Thanks to you too Pete for your advice and help.
I will try and ensure I post in the right place next time. No harm meant.

The compiler is the most nit-picking, infuriatingly pedantic device known.
You just have to out-pedant it.

You can set your cursor to the right of any brace [{()}].
IDE will then put a small blue box around the brace it belongs to.
If they do not belong together, you probably are missing one or have misplaced one.