Is there a brace missing here?

This example is in the reference under "return" I see 5 braces, is there one missing or one extra? Mark S.

int checkSensor(){ if (analogRead(0) > 400) { return 1; else{ return 0; } }

There is indeed one closing brace missing before the else. This should produce an "else without previous if" error or at least an "expected } at end of input".

Cool! I found an error in the online documentation- I guess I've learned more in just 2 weeks than I thought. (just a babe in the coding woods) How do we go about getting that corrected? Mark S.

markba633csi: How do we go about getting that corrected?

That question has been around and unanswered for a very long time.

Good eye spotting it though.

I suggest you always keep braces on a line by themselves. IMO this helps th eye to see what is happening.

int checkSensor()
{       
    if (analogRead(0) > 400) 
     {
        return 1;

    else
     {
        return 0;
     }
}

There must be a place to report errors in the reference section- I shall do some hunting, and report what I find. Mark S.

markba633csi: There must be a place to report errors in the reference section- I shall do some hunting, and report what I find. Mark S.

Oh there's a place to report them. It's getting anything done about it that's the problem.

Ah I see, and it has been reported about 9 days ago on github by ricardoglobal. Darn he beat me to it LOL If it isn't fixed in a couple weeks I'll remind them (gently, with feeling) again. Mark S. ps that's a great technique putting braces on lines by themselves, much clearer

Put a reminder on your calendar program. Make it repeat every couple of weeks with a termination date of 2020

.

It's not missing any brackets, it's got 3 extra :P