newby compile error

this program is from Franzis tutorial kit for arduino reads an input and outputs to a led

//franzis arduino

// read in button via io-pin

int led=13;

int pin=12;

int value=0;

void setup()

{

pinMode(led, OUTPUT);

pinMode(pin, INPUT);

digitalWrite(pin, HIGH);

}

void loop()

{

value=digitalRead(pin);

digitalWrite(led, value);

it produces a compile error

void does not name a type in function ‘void setup’ in global scope.

can someone tell me what i am missing please

i have registered twice in the past week on the ardunio.cc forum but have not yet been sent an e-mail to activate my account so asking for help on this forum please

You’re missing the last line which should be a right brace, }.

int led=13;
int pin=12;
int value=0;

void setup()
{
  pinMode(led, OUTPUT);
  pinMode(pin, INPUT);
  digitalWrite(pin, HIGH);
}
void loop()
{
  value=digitalRead(pin);
  digitalWrite(led, value);
}

cheers for the reply i only missed the closing brace when typing to this website

i have the closing braces in the sketch but still producing the compile error

but thanks

I copy/pasted your original code (and added the last bracket), and got no compile error.

What version of the IDE are you using? Not sure if it matters, but I have 1.0.5.

RonBeyer:
I copy/pasted your original code (and added the last bracket), and got no compile error.

Same here.

i originally used 18 and it did not work i upgraded to 1.05 and it still did not work.

i am pleased that it is a local fault to me and i will delete the sketch and rewrite it and compile it again and be in touch with the results.

and thanks for taking the time to help me.

solved thank you for your help.

i could not see the wood for the trees.

i wrote the sketch again and it compiled perfectly.

i then scrutinised each line of the first attempt and found that i had originally capalized void loop() as VOID LOOP()

I rectified the mistake and voila perfect.

believe me i checked the syntax a good few times (wood trees)

thank you very much for both your help