#include <Bounce2.h>
Bounce btn =Bounce(2,50);
int led =13;
int ledstate=LOW;
long previousMillis = 0;
long interval = 1000;
int lcd=HIGH;
void setup() {
pinMode(2,INPUT);
pinMode(led,OUTPUT);
}
void loop() {
unsigned long currentMillis = millis();
if(lcd==LOW);
{
if(currentMillis - previousMillis > interval)
{
previousMillis = currentMillis;
ledstate=LOW;
digitalWrite(led,ledstate);
lcd=HIGH;
}
}
if(btn.update()==true && btn.read()==HIGH)
{
lcd=LOW;
if(ledstate==LOW)
{
ledstate=HIGH;
}
else
{
ledstate=LOW;
}
digitalWrite(led,ledstate);
}
}