I’m kinda new to Arduino so maybe I am missing something.
The if statement will not execute in this sketch. I know n = 0 every 10 minutes because I did a serial print just before the if statement.
n = minute % 10; //log data every 10 minutes
if (n = 0 ){ // time to log data?
logData(); // yes do it
}
But this one works!!!
n = minute % 10; //log data every 10 minutes
if (n < 1 ){ // time to log data?
logData(); // yes do it
}
OK so somebody tell me what’s wrong so I can look real stupid.
if your fairly new to programing you can do it like (0 == n) that way if you mess up it should throw up an error, but if your in the habit of the other way its kind of hard to break
I knew somebody could make me look stupid!! cause I new about the difference between = & ==. It just didn't register. I'm more familiar with Visual Basic. Thanks for the reply. Case closed!