const int BUTTON = 2;
const int LED = 3;
int BUTTONstate = 0;
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:
BUTTONstate = digitalRead(BUTTON);
if(BUTTONstate == HIGH){
digitalWrite(LED, HIGH);
}
else{
digitalWrite(LED, LOW);
}
}