/*int plane600LED = 9;
int plane500LED = 10;
int plane400LED = 11;
int plane300LED = 12;
int gld600LED = 8;
int gld500LED = 7;
int gld400LED = 6;
int gld300LED = 5;
int slowApproachPin = 4;
*/
const int nominalApproachPin = 3;
//int fastApproachPin = 2;
const int ledPins [] = {5,6,7,8};
int currentLED = 0;
void setup() {
// put your setup code here, to run once:
pinMode(nominalApproachPin, INPUT_PULLUP);
for (int i = 0; i < 4; i++) {
pinMode(ledPins[i], OUTPUT);
}
/*pinMode(plane600LED, OUTPUT);
pinMode(plane500LED, OUTPUT);
pinMode(plane400LED, OUTPUT);
pinMode(plane300LED, OUTPUT);
pinMode(gld600LED, OUTPUT);
pinMode(gld500LED, OUTPUT);
pinMode(gld400LED, OUTPUT);
pinMode(gld300LED, OUTPUT);
pinMode(slowApproachPin, INPUT_PULLUP);
pinMode(nominalApproachPin, INPUT_PULLUP);
pinMode(fastApproachPin, INPUT_PULLUP);
Serial.begin(9600);
digitalWrite(plane600LED, HIGH);
digitalWrite(gld600LED, HIGH);
*/
}
void loop() {
// put your main code here, to run repeatedly:
int buttonState = digitalRead(nominalApproachPin);
if (buttonState == LOW) { // If button is pressed
// Turn off the current LED
digitalWrite(ledPins[currentLED], LOW);
// Advance to the next LED
currentLED = (currentLED + 1) % sizeof(ledPins) / sizeof(ledPins[0]);
// Turn on the new LED
digitalWrite(ledPins[currentLED], HIGH);
}
}