const int led = PB2; // pin -> LED -> GND
const int button = PB3; // pin -> button -> GND
void setup() {
pinMode(button, INPUT_PULLUP); // tied HIGH
pinMode(led, OUTPUT);
digitalWrite(led, LOW); // turn LED pin off
}
void loop() {
while (digitalRead(button)) // HIGH when button not pressed
digitalWrite(led, LOW); // LED off
digitalWrite(led, HIGH); // button pressed
}
/*
+-- --+
PCINT5/-RESET/ADC0/dW/PB5 |1 * 8| VCC
PCINT3/XTAL1/CLKI/-OC1B/ADC3/PB3 |2 7| PB2/SCK/USCK/SCL/ADC1/T0/INT0/PCINT2
PCINT4/XTAL2/CLKO/OC1B/ADC2/PB4 |3 6| PB1/MISO/DO/AIN1/OC0B/OC1A/PCINT1
GND |4 5| PB0/MOSI/DI/SDA/AIN0/OC0A/-OC1A/AREF/PCINT0
+-----+
*/