wanted the option to blink the words in series instead of at once.
As soon as we got them blinking, we saw the problem. The border significantly dimmed when the words came on, then got nice and bright when they went off. Not a nice effect. That was using this program:
const int border = 2;
const int wire1 = 3;
const int wire2 = 4;
const int wire3 = 5;
const int numberOfWires = 4;
const int delayTime = 750;
int wires[] = {
wire1,wire2,wire3,border};
void setup() {
for(int i = 0; i < numberOfWires; i++) {
pinMode(wires[i], OUTPUT);
}
digitalWrite(border, HIGH);
}
void loop() {
for(int i = 0; i < numberOfWires-1; i++) {
digitalWrite(wires[i], HIGH);
}
delay(delayTime);
for(int i = 0; i < numberOfWires-1; i++) {
digitalWrite(wires[i], LOW);
}
delay(delayTime);
}
I had an idea it might be possible to get around the significant dimming by strobing the border and word wires imperceptibly fast to maintain the high power to the border, and it worked! Here is that code:
const int border = 2;
const int wire1 = 3;
const int wire2 = 4;
const int wire3 = 5;
const int numberOfWires = 4;
const int delayTime = 750;
int wires[] = {
wire1,wire2,wire3,border};
void setup() {
for(int i = 0; i < numberOfWires; i++) {
pinMode(wires[i], OUTPUT);
}
digitalWrite(border, HIGH);
}
void loop() {
for(int i = 0; i < 50; i++) {
for(int i = 0; i < numberOfWires-1; i++) {
digitalWrite(wires[i], HIGH);
}
digitalWrite(border, LOW);
delay(15);
for(int i = 0; i < numberOfWires-1; i++) {
digitalWrite(wires[i], LOW);
}
digitalWrite(border, HIGH);
delay(15);
}
for(int i = 0; i < numberOfWires-1; i++) {
digitalWrite(wires[i], LOW);
}
digitalWrite(border, HIGH);
delay(delayTime);
}
You can see how nicely it worked in these two pictures comparing the on and off states. The video below actually picks up the strobing but you lose the brightness:
No comments :
Post a Comment