Hey,
In my program, I want two sets of code to run at different time instances.
Basically, I want my external LCD refreshing information every 333ms, and I want the Arduino to only send this data serially to my Visual Basic program every second (3 x 333ms).
However, I'm having problems implementing this.
int serialcount = 0;
void setup(){}
void loop(){
serialcount++;
if (serialcount=3){
...
INSERT Serial.print CODE HERE
...
serialcount=0}
delay(333)
}
The code inside the if statement should only be working every third loop, but it running every loop instance.
What am I missing?