Passage of time v0.1
Here’s my second iteration of the time piece. This prototype is a much higher fidelity and uses a tallish container I got from the container store. I’m using the container upside down with a hole cut at the bottom end for the USB cable and the Arduino stuck on the lid of the container. The LED’s are mounted around a tall cardboard structure, in 3 rows, which sits tight once stuck inside the container. The LED’s light up one row at a time and the light appears to move up and down the container. Row 1 and 3 are blue LED’s while row 2 is green LED’s. Kitchen towels doubled and nicely tucked into the container are used to diffuse the light.
int timer = 50; // The higher the number, the slower the timing.
int pins[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }; // an array of pin numbers
int num_pins = 12; // the number of pins (i.e. the length of the array)
int timer2 = 1000;
void setup()
{
int i;
for (i = 0; i < num_pins; i++) // the array elements are numbered from 0 to num_pins – 1
pinMode(pins[i], OUTPUT); // set each pin as an output
}
void loop()
{
int i;
//down up
//bottom row
for (i = 8; i < 12; i++) { // loop through each pin…
digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
//digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
for (i = 8; i < 12; i++) { // loop through each pin…
//digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
//
for (i = 4; i < 8; i++) { // loop through each pin…
digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
//digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
for (i = 4; i < 8; i++) { // loop through each pin…
//digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
//
for (i = 0; i < 4; i++) { // loop through each pin…
digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
//digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
for (i = 0; i < 4; i++) { // loop through each pin…
//digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
//up down
//
for (i = 0; i < 4; i++) { // loop through each pin…
digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
//digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
for (i = 0; i < 4; i++) { // loop through each pin…
//digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
//
for (i = 4; i < 8; i++) { // loop through each pin…
digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
//digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
for (i = 4; i < 8; i++) { // loop through each pin…
//digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
//bottom row
for (i = 8; i < 12; i++) { // loop through each pin…
digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
//digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer);
for (i = 8; i < 12; i++) { // loop through each pin…
//digitalWrite(pins[i], HIGH); // turning it on,
//delay(timer); // pausing,
digitalWrite(pins[i], LOW); // and turning it off.
}
delay(timer2);
}
Reply