Time – The dying arrow
The dying arrow is a project made of red and orange LEDs, that are all HIGH , and then turn one to one LOW. Such as a neon symbol not functioning well in bars, the "dying arrow" shows the passage of time where life goes off.
I really enjoyed the rough aspect of my prototype, where you can see the wire, as well as the reflection of the red LEDs on the shiny black paper.
I want my piece to preserve a rough aspect as a mechanism of the old times, and I will put mirrors around it to enhance its life and death.
I had a hard time trying several possibilities in my code. It is not finished yet, and need to work on it a lot more! But it shows all the LEDs on HIGH with two of them blinking.
I didn't use arrays because I couldn't get it working as I wanted.
/* Myriam Aboukhater – code for the "Dying Arrow"
13 LEDs are on HIGH at first, then they blink and pass on LOW one at a time
*/
int Pin1 = 1;
int Pin2 = 2;
int Pin3 = 3;
int Pin4 = 4;
int Pin5 = 5;
int Pin6 = 6;
int Pin7 = 7;
int Pin8 = 8;
int Pin9 = 9;
int Pin10 = 10;
int Pin11 = 11;
int Pin12 = 12;
int Pin13 = 13;
int value = HIGH; // previous value of the LED
long previousMillis = 0; // will store last time LED was updated
long interval = 1000; // interval at which to blink (milliseconds)
void setup()
{
pinMode (Pin1, OUTPUT);
pinMode (Pin2, OUTPUT);
pinMode (Pin3, OUTPUT);
pinMode (Pin4, OUTPUT);
pinMode (Pin5, OUTPUT);
pinMode (Pin6, OUTPUT);
pinMode (Pin7, OUTPUT);
pinMode (Pin8, OUTPUT);
pinMode (Pin9, OUTPUT);
pinMode (Pin10, OUTPUT);
pinMode (Pin11, OUTPUT);
pinMode (Pin12, OUTPUT);
pinMode (Pin13, OUTPUT);
}
void loop()
{
digitalWrite (Pin1, HIGH);
digitalWrite (Pin2, HIGH);
digitalWrite (Pin3, HIGH);
digitalWrite (Pin4, HIGH);
digitalWrite (Pin5, HIGH);
digitalWrite (Pin6, HIGH);
digitalWrite (Pin7, HIGH);
digitalWrite (Pin8, HIGH);
digitalWrite (Pin9, HIGH);
digitalWrite (Pin10, HIGH);
digitalWrite (Pin11, HIGH);
digitalWrite (Pin12, HIGH);
digitalWrite (Pin13, HIGH);
// if (millis() – previousMillis > interval) {
//previousMillis = millis(); // remember the last time we blinked the LED
if (value == HIGH) {
digitalWrite(Pin3, LOW); // sets the LED on
delay(70); // waits for a second
digitalWrite(Pin3, HIGH); // sets the LED off
delay(70); // waits for a second
digitalWrite(Pin7, LOW); // sets the LED on
delay(10); // waits for a second
digitalWrite(Pin7, HIGH); // sets the LED off
delay(10);
}
}
}
Reply