Okay, got some more (hopefully useful!) information.
I’ve now written a stand alone LED tester, the code is just:
namespace LEDTester
{
using System;
using BlinkStickDotNet;
using System.Drawing;
class Program
{
static void Main(string[] args)
{
byte[] TestChannels = new byte[] { 0, 1, 2 };
Console.WriteLine("Connecting to BlinkStick device...");
BlinkStick device = BlinkStick.FindFirst();
if (device == null)
{
Console.WriteLine("ERROR: Could not find device.");
}
else
{
device.SetMode(2);
WriteGreenText(String.Format("Connected to device '{0}'" + Environment.NewLine, device.Serial));
if (device.OpenDevice())
{
Console.WriteLine("Turning off LEDs on all channels");
foreach (byte channel in TestChannels)
{
Console.Write("Channel" + channel + "...");
device.SetColors(channel, CreateByteColourArray(Color.Black));
Console.Write(" OK" + Environment.NewLine);
}
foreach (byte channel in TestChannels)
{
Console.WriteLine(Environment.NewLine + "Testing Channel" + channel + " ... ");
WriteGreenText("Test #1 Solid Colour Test.");
Color[] Test = new Color[] { Color.Red, Color.Green, Color.Blue, Color.White };
foreach (Color ToTest in Test) {
Console.Write(ToTest.ToString() + " ");
device.SetColors(channel, CreateByteColourArray(ToTest));
System.Threading.Thread.Sleep(2000);
}
WriteGreenText(Environment.NewLine + "All Colours tested.");
device.SetColors(channel, CreateByteColourArray(Color.Black));
WriteGreenText("Test #2 Single Colour Pixel Test.");
foreach (Color ToTest in Test)
{
Console.Write(ToTest.ToString() + " ");
for (int f = 0; f < 64; f++) {
Console.Write(f + ",");
device.SetColors(channel, CreateByteColourArray(ToTest, f));
System.Threading.Thread.Sleep(100);
}
Console.Write(Environment.NewLine);
}
WriteGreenText(Environment.NewLine + "All Colours tested.");
device.SetColors(channel, CreateByteColourArray(Color.Black));
System.Threading.Thread.Sleep(1000);
}
}
else {
Console.WriteLine("ERROR: Could not open device.");
}
}
Console.ReadLine();
}
static void WriteGreenText(string info) {
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine(info);
Console.ResetColor();
}
static byte[] CreateByteColourArray(Color color, int SingleColourPixel = -1) {
int NumLEDs = 64;
byte[] data = new byte[3 * NumLEDs];
for (int c = 0; c < NumLEDs * 3; c+=3)
{
if (SingleColourPixel == -1)
{
data[c] = color.G;
data[c + 1] = color.R;
data[c + 2] = color.B;
}
else {
byte n = 0;
data[c] = (c / 3) == SingleColourPixel ? color.G : n;
data[c + 1] = (c / 3)== SingleColourPixel ? color.R : n;
data[c + 2] = (c / 3) == SingleColourPixel ? color.B : n;
}
}
return data;
}
}
}
if I run this on my system I get the following results:
(sorry for rubbish quality. hope you can make it out!
If you’d like me to test anything else please let me know.