int buttonValue = 0;
int LED = 2;
int Button = 3; // Declare the pin number for the button
void setup() {
// put your setup code here, to run once:
pinMode(Button, INPUT);
pinMode(LED, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
buttonValue = digitalRead(Button);
if(buttonValue != 0){
digitalWrite(LED, HIGH);
} else {
digitalWrite(LED, LOW); // Change to LOW to turn off the LED
}
}