int LedPin = 12;
int ButtonPin = 7;
void setup() {
// put your setup code here, to run once:
pinMode(LedPin, OUTPUT);
pinMode(ButtonPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int ButtonState = digitalRead(ButtonPin);
if (ButtonState == LOW) {
digitalWrite(LedPin, HIGH);
}
if (ButtonState == HIGH) {
digitalWrite(LedPin, LOW);
}
}