Submitted by JV (not verified) on Fri, 01/28/2011 - 10:47.
I've been playing with this code. I am using a chain of 12 SBs. I've modified to support 12...
int chainLength = 4; //Number of ShiftBrites in chain
int image[4][3]; //R,G,B for each ShiftBrite in the chain, first element is No. of SB's in chain
...to...
#define chainLength 12 //Number of ShiftBrites in chain
int image[chainLength ][3]; //R,G,B for each ShiftBrite in the chain, first element is No. of SB's in chain
I found that with a 1 millisecond delay for the latchpin I was getting some flickering on some of the SBs. I modified this to use delayMicroseconds() instead with a value of 1500 microseconds. This helped remove the flickering.
delay(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,HIGH); // latch data into registers
delay(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,LOW);
...to...
delayMicroseconds(1500); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,HIGH); // latch data into registers
delayMicroseconds(1500); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,LOW);
I then wanted to try to max out the brightness of all of the SBs. I changed...
image[i][1] = 100; //Set new to max
...to...
image[i][0] = 1023; //Set new to max
image[i][1] = 1023; //Set new to max
image[i][2] = 1023; //Set new to max
This seems to cause flickering in some SBs again. I adjusted the latch timing again and was able to remove the flickering. This tells me that there should be some sort of equation for determining the correct latch timing. It would seem to be based on how many SBs in the chain, total brightness (r+g+b), the rate of expected brightness change (in this case how fast the chase is running), maybe how many SBs are currently lit, maybe distance between individual SBs, etc.
Does anyone have any insight in to how this might work and/or what this equation might look like? I would very much like to be able to solve this in code so that I can handle many different color combination, brightness levels and timing issues (fades, rapid color changes, etc) on the fly.
I've been playing with this
I've been playing with this code. I am using a chain of 12 SBs. I've modified to support 12...
int chainLength = 4; //Number of ShiftBrites in chain
int image[4][3]; //R,G,B for each ShiftBrite in the chain, first element is No. of SB's in chain
...to...
#define chainLength 12 //Number of ShiftBrites in chain
int image[chainLength ][3]; //R,G,B for each ShiftBrite in the chain, first element is No. of SB's in chain
I found that with a 1 millisecond delay for the latchpin I was getting some flickering on some of the SBs. I modified this to use delayMicroseconds() instead with a value of 1500 microseconds. This helped remove the flickering.
delay(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,HIGH); // latch data into registers
delay(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,LOW);
...to...
delayMicroseconds(1500); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,HIGH); // latch data into registers
delayMicroseconds(1500); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,LOW);
I then wanted to try to max out the brightness of all of the SBs. I changed...
image[i][1] = 100; //Set new to max
...to...
image[i][0] = 1023; //Set new to max
image[i][1] = 1023; //Set new to max
image[i][2] = 1023; //Set new to max
This seems to cause flickering in some SBs again. I adjusted the latch timing again and was able to remove the flickering. This tells me that there should be some sort of equation for determining the correct latch timing. It would seem to be based on how many SBs in the chain, total brightness (r+g+b), the rate of expected brightness change (in this case how fast the chase is running), maybe how many SBs are currently lit, maybe distance between individual SBs, etc.
Does anyone have any insight in to how this might work and/or what this equation might look like? I would very much like to be able to solve this in code so that I can handle many different color combination, brightness levels and timing issues (fades, rapid color changes, etc) on the fly.
Thanks!