Hi everyone ,
I am trying to make a code to work for X seconds , when I dont use :
if (Serial.available() > 0)
It works perfectly , but I want to time to be started after the if (Serial.available() > 0), but it does not work.
The working code is :
time = millis();
if(time < 9000) {
if (Serial.available() > 0)
{
//MY CODE
}
}
but since i want the millis() to start after the user CLICK the button Serial.available() > 0, because the number 9000 will be a variable that the user enter in the PHP side , i do :
time = millis();
if (Serial.available() > 0)
{
if(time < 9000) {
//MY CODE
}
}
but its not working unfortunately , any help would be very appreciated.
thanks alot