// *********************************************
// * *
// * NAME : Andreas Pardalis *
// * Program Name: sketch.io *
// * Date : 2022-02-13 *
// * : Our first program to *
// * turn on led pin 13 *
// *
// *********************************************
int delayTime = 3000; // delay time for my blinky lights
int pinkLED = 12; // pin for pink LED
int blueLED = 11; // pin for blue LED
int orangeLED = 10; // pin for orange LED
int buttonPin = 8; // the pin for our button
int buttonValue = 0;
void setup() {
pinMode(pinkLED, OUTPUT); // config pin 12 to an OUTPUT
pinMode(blueLED, OUTPUT); // config pin 11 to an OUTPUT
pinMode(orangeLED, OUTPUT); // CONFIG pin 10 to an OUTPUT
Serial.begin(9600);
} // end setup()
void loop() {
buttonValue = digitalRead(buttonPin);
Serial.print(buttonValue);
if (buttonValue == HIGH){
delayTime = delayTime - 100;
if (delayTime < 200) {
delayTime = 3000;
} // end if()
Serial.println(delayTime);
}
digitalWrite(pinkLED, HIGH); // send power to pin 12
digitalWrite(blueLED, LOW); // turn off power to pin 11
digitalWrite(orangeLED,LOW);
delay(delayTime); // wait 2 seconds
digitalWrite(pinkLED, LOW); // turn off power to pin 12
digitalWrite(blueLED, HIGH); // send power to pin 11
digitalWrite(orangeLED, LOW); // send power to pin 10
delay(delayTime); // wait 5 seconds
digitalWrite(pinkLED,LOW); // turn off power to pin 12
digitalWrite(blueLED, LOW); // turn off power to pin 11
digitalWrite(orangeLED, HIGH); // send power to pin 10
delay(delayTime);
} // end loop()