int pinInput = 2;
int pinOutput = 13; // LED_BUILTIN
int switchState = 0;
void setup() {
// put your setup code here, to run once:
pinMode(pinInput, INPUT);
pinMode(pinOutput, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
switchState = digitalRead(pinInput); // will read HIGH OR LOW
digitalWrite(pinOutput, switchState);
/* So if we pushed the button, the pinInput (2) will be connected to
HIGH (+)
else the pinInput will be connected to the PULLDOWN resistor which is connected
to LOW (-)
*/
}