hii
im new to arduino and im using Tinkercad circut simulator.
in my disign i have sevrel parts suche as LEDs ,7 segment and i want to use pushbutton.
i have 18 sec delay overall in my code.
i want the user to push the button once any time he likes during the loop. i want to save his choise for activate a function the next time the loop begin.
there is a way to save the the choise when the button is no longer pressed??
this the my code:
unsigned const int PUSH=3;
int Bmode=0;
void setup()
{
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(PUSH, INPUT);
}
void loop()
{
Bmode = digitalRead(PUSH);
if (Bmode == 1) {
SevenSeg();Bmode=0;
}
delay(10);
digitalWrite(11, HIGH);
delay(6000); // Wait for 6 sec
digitalWrite(11, LOW);
digitalWrite(12, HIGH);
delay(3000); // Wait for 3 sec
digitalWrite(12, LOW);
digitalWrite(13, HIGH);
delay(9000); // Wait for 9 sec
digitalWrite(13, LOW);
thanks..