larryd:
if (250 < lightlevel && lightlevel < 800)
change to
if (lightlevel > 250 && lightlevel < 800)
Respectfully disagree.
The original clearly show that lightlevel test is BETWEEN 250 and 800
Machine "reads " same as most humans - from left to right.
if (250 < lightlevel && lightlevel < 800)
{
digitalWrite(direction1, LOW);
digitalWrite(direction2, LOW);
}
As far as the "typo" - on my IDE when I type if( the closing parenthesis gets automatically added and when I type {
and " enter " closing } is added
so I end up with
if()
{
}
then all I have to do is "fill in the blanks". It behave similar in most constructs.
I suppose most people write code piece by piece thus typos can result.
Happy coding.