missing a curly
digitalWrite(ledPin, HIGH); // turn LED on
Should be:
this is the error i get if i
this is the error i get if i use that
In function ‘void loop()’:
error: a function-definition is not allowed here before ‘{’ toke
maybe some more curlies?
I don’t actually speak C. 8-(
But I know to make my parentheses symmetric. Always. Smileys are the only exception.
Check for all { } and ( ) and [ ] . Are they properly opened/closed?
Also: I am not sure if you need that second and third void loop() declaration. But then again: my language is Perl, not C.
test this
the ‘else’ error may be solved as below
A little tip. Anytime you
A little tip. Anytime you write code and you find yourself using a bracket to group code { and } ALWAYS put the close bracket in the code right away.
If blah blah blah
{
}
And then write the code inside the IF statement. This prevents some of the problems above where you close out a bracket and it applies to the function instead of somewhere else. Also put brackets on their own line so it makes it readable
IF blah blah blah {
code code code
}
Isn’t as readable.