const int buttonPin = 2;
const int LedPin = 13;
int buttonState=0;
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:
buttonState = digitalRead(buttonPin);
if(buttonState == HIGH)
{
Serial.println("HIGH");
digitalWrite(LedPin, HIGH);
}
else
{
Serial.println("LOW");
digitalWrite(LedPin, LOW);
}
}