#define Buttun 8
#define LED 12
bool state = false;
void setup() {
pinMode(LED, OUTPUT);
pinMode(Buttun, INPUT_PULLUP); // put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
if(digitalRead(Buttun)==0){
state=!state;
digitalWrite(LED, state);
if (state == true){
Serial.println("LED is ON");
}
else{
Serial.println("LED is OFF");
}
delay(300);
}
// put your main code here, to run repeatedly:
}