- Mon Apr 18, 2011 11:07 pm
#125691
I have one of the "ding and dent" addressable RGB strips and an having issues getting it to function as I expect it should. I'm controlling it with a FEZ Domino, 3.3V logic (perhaps the issue) and using a secondary 5V power supply for the power lines on the strip.
The problem is that I can't get anything but the first LED to light up. I can change it's color at will, but no matter how may bits I clock in nothing seems to overflow to the second LED or any other than the first. Is there a common issue here I'm overlooking?
Code below:
var r = new Random();
var led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, false);
var data = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.Di0, true);
var clk = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.Di1, true);
var colors = new uint[32];
for (int i = 0; i < colors.Length; ++i)
colors = (uint)r.Next(0xFFFFFF);
while (true)
{
for (int i = 0; i < colors.Length; ++i)
{
uint color = colors;
uint mask = 1;
for (int b = 0; b < 24; ++b)
{
var bit = ((mask & color) == mask);
clk.Write(false);
data.Write(bit);
clk.Write(true);
mask = (mask << 1);
}
}
clk.Write(false);
Thread.Sleep(200);
The problem is that I can't get anything but the first LED to light up. I can change it's color at will, but no matter how may bits I clock in nothing seems to overflow to the second LED or any other than the first. Is there a common issue here I'm overlooking?
Code below:
var r = new Random();
var led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, false);
var data = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.Di0, true);
var clk = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.Di1, true);
var colors = new uint[32];
for (int i = 0; i < colors.Length; ++i)
colors = (uint)r.Next(0xFFFFFF);
while (true)
{
for (int i = 0; i < colors.Length; ++i)
{
uint color = colors;
uint mask = 1;
for (int b = 0; b < 24; ++b)
{
var bit = ((mask & color) == mask);
clk.Write(false);
data.Write(bit);
clk.Write(true);
mask = (mask << 1);
}
}
clk.Write(false);
Thread.Sleep(200);