#define LED_PIN 5 #define BUTTON_PIN 6 void setup() { // put your setup code here, to run once: pinMode(LED_PIN,OUTPUT); pinMode(BUTTON_PIN,INPUT); } void loop() { // put your main code here, to run repeatedly: if(digitalRead(BUTTON_PIN)== HIGH){ digitalWrite(LED_PIN,HIGH); }else{ digitalWrite(LED_PIN,LOW); } }