Hi !
I'm trying to get an action to be delayed and all of the examples I found were using the millis() to toggle true or false statement continuously so I'm not sure how to make it work for my problem..
basically I have a button that would execute "action A" when when pressed. when it's complete I'd like the program to wait 30 seconds before letting the user execute "action A". In the meantime when the button is pressed I'd like the code to execute an "action B" while waiting...
my code would look like that.. any help please ?
int buttonState = 0;
int progState = 1; //1 = good to go //0 = not ready
long previousMillis = 0;
long interval = 30000;
const int buttonPin = 2;
Take a look at my thread: Arduino Forum. There is a bit of a fault there, but I think that you can implement the function into your code. Also, look at the Blink Without Delay example. They both use millis().