const int buttonPin = 16;
const int ledPin = 33;
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
}
void loop() {
if (digitalRead(buttonPin) == LOW) {
// LED pattern: 3 long, 2 short, 3 very short
blink(3, 500); // 3 long blinks
blink(2, 200); // 2 short blinks
blink(3, 100); // 3 very short blinks
delay(1000);
}
}
void blink(int times, int duration) {
for (int i = 0; i < times; i++) {
digitalWrite(ledPin, HIGH);
delay(duration);
digitalWrite(ledPin, LOW);
delay(duration);
}
}