int ledPin = 2; // This is the pin of the ATtiny1614 connected to the REDled int buttonPin = 1; // This is the pin of the ATtiny1614 connected to the button int buttonState = 0; void setup() { pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT_PULLUP); Serial.begin(115200); } void loop() { buttonState = digitalRead(buttonPin); if (buttonState == LOW) { Serial.print("BUTTON ON"); // Since it's a pull up botton, the LED is on when the buttonState is LOW Serial.println("\""); digitalWrite(ledPin, HIGH); delay (50); digitalWrite(ledPin, LOW); delay (50); } else { Serial.print("BUTTON OFF"); Serial.println("\""); digitalWrite(ledPin, LOW); // If the button is not pressed the RED light is off. } }