Problem with OctoWS2811 adaptor and / or library and/ or my understanding

Status
Not open for further replies.

G-Prime

New member
In the past, I have used the Arduino platform with Adafruit NeoPixel strips and the Adafruit libraries for a few projects. I am now planning a project with a pixel count in the thousands and will be implementing it with a Teensy3.2, OctoWS2811 board and the Octows2811 library.

My WS2812B strips are currently somewhere between China and me, so I am testing the hardware with a single 60 pixel strip I had on hand. While trying out the WS2811 library, I've encountered issues that I can't explain.

I know the Octo is designed to work with 8 strips, but I suppose using a single strip connected to the first data line should allow me to at least test some code. If this is my mistake and I should only test with 8 strips connected, please disregard the following and let me know.

This is my setup:

- Teensy 3.2 mounted on OctoWS2811 board
- 60 pixel/m Adafruit Neopixel strip, 1m long = 60 pixels
- in the code, const int ledsPerStrip = 60;
- Cat6 cable (≈30cm) plugged in top port:
  • orange wire connected to "data in" on LED strip
  • orange-white wire connected to ground on LED strip
- 5V 10A power supply (cable from power supply to LED strip ≈1m):
  • ground connected to orange-white wire at the LED strip
  • +5V connected to 5V on LED strip
I have two issues:

== First issue - first pixel ==
- Erratic behaviour with the first pixel. It often lights up as full white (0xFFFFFF) immediately after uploading a hex to the Teensy.
- Can't be controlled by code. It is not included in the LED count: pixel index 0 in code is controlling the second pixel on the physical strip (instead of the first)
- All pixel indexes are therefore offset by one.

== Second issue - colour values above 127 ==
Colour values above 127 don't work properly. See attached video and code.

Code:
#include <OctoWS2811.h>

const int ledsPerStrip = 60;
DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];

const int config = WS2811_GRB | WS2811_800kHz;
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);

void setup() {
  leds.begin();
  leds.show();

  for (int i=0; i<256; i++){.  // loop over 256 intensity values for R, G, and B
    leds.setPixel(2, i, 0, 0);
    leds.setPixel(4, 0, i, 0);
    leds.setPixel(6, 0, 0, i);
    leds.show();
    delay(10);
  }
}

void loop() {
}
Here's the video of what happens: [video]https://www.facebook.com/flcharron/videos/vb.721749965/10156359565479966/?type=2&theater[/video]

Things to notice in the video:
  • The pixels that light up are 4, 6, and 8. The code tells pixels 3, 5, and 7 to light up. This corresponds to the first pixel indexing issue I mention.
  • The pixels go from dark to full twice, even though the code only loops from 0 to 255 once. The pixels restart from dark at 128.
  • Green values above 127: slightly noticeable, in the second part of the loop (values 128-255) the pixel coming before the green one is showing a bit of blue.
  • Blue values above 127: Not noticeable in the video but similar to the green issue, pixels with blue values above 127 will also show a little bit of red.
Upon further testing, the pixel coming just before a pixel with green above 127 will ALWAYS show some blue.
I also took a picture to illustrate the these issues.
OctoWS2811_test.jpg

And the code that generated this:
Code:
void setup() {
  leds.begin();
  leds.show();
  //           idx   R    G    B   
  leds.setPixel(2,   0,   0,   130);   // blue above 127 (no red)  
  leds.setPixel(4,   2,   0,    0 );   // low red (no blue)
  leds.setPixel(5,   0,   130,  0 );   // green above 127
  leds.show();
}


Here, we notice:
  • The first pixel is fully lit (shaded by a piece of white paper, first issue mentioned in my post).
  • The blue pixel (index 2) has some red showing in it because it has a B value above 127
  • The red pixel (index 4) has some blue showing in it because the next pixel (index 5) has a G value above 127

I can confirm the the same Neopixel strip works properly with an Arduino project using the Adafruit library. I really doubt I'm running into power issues since I'm testing with a few pixels, drawing a couple hundred mA at most.

Can someone tell me what I am doing wrong (rookie mistake wouldn't surprise me), or give me leads to investigate?

Thanks!
 
first led in 50 led strip not working

This was a bug. It's been fixed in Teensyduino 1.37.

https://www.pjrc.com/teensy/td_download.html

Is it possible that this bug came back in Teensyduino 1.41? I am using it with the below code with Vixen, Teensy 3.2 + adapter board and the first LED is white although the others work.

#include <OctoWS2811.h>

const int ledsPerStrip = 50; // Maximum number of pixels per string
int PixelCount = 50; // Effective number of pixels
float hell = 0.50; // Dimmer 1.00 = 100% brightness - 0.50 = 50% brightness

DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];
const int config = WS2811_GRB | WS2811_800kHz;
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);
int pixelValue = 0;

void setup()
{
delay(300);
Serial.begin(115200); // Speed of data transmission from Vixen Lights 3 to the Arduino

leds.begin();
for (int i=0;i<PixelCount;i++) // Initialization - Once all LEDs light up blue
{
leds.setPixel(i, 0, 0, 200*hell);
}
leds.show();
delay (5000);
for (int i=0;i<PixelCount;i++)
{
leds.setPixel(i, 0, 0, 0);
}
leds.show();
}

void loop()
{

if (Serial.available()>5) // Wait for data transmission from Vixen Lights
{
waitForVixenHeader(); // Call function: Waiting for start string

for (int pixCount=0; pixCount<PixelCount;pixCount++) // Do this for as many Pixels defined in PixelCount
{
int RGB[3]; // Array for the three RGB color valuesArray for the three RGB color values
for (int color = 0;color<3;color++) // Three values each form one RGB LED
{
while (Serial.available() < 1) // Wait for the next number
{
delay(10);
}
RGB[color] = int(Serial.read()*hell); // Assign color value to the array with brightness correction
} // Repeat until all three values are read

leds.setPixel(pixCount, RGB[1], RGB[0], RGB[2]);

} // Repeat until all LEDs are read
leds.show(); // Activate color patterns
} // Get the next color pattern
} // Loop end

void waitForVixenHeader()
{
char *header="VIXStart";
char buffer[8];
int index = 0;

while (true)
{
int inByte = Serial.read();
if(inByte==-1)
{
continue;
}

buffer[index] = inByte;
if(buffer[index]!=header[index])
{
index=-1;
}

buffer[index+1] = 0;
index++;
if(index==8)
{
return;
}
}
}
 
Status
Not open for further replies.
Back
Top