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:
== 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.
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:
I also took a picture to illustrate the these issues.
And the code that generated this:
Here, we notice:
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!
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
- ground connected to orange-white wire at the LED strip
- +5V connected to 5V on LED strip
== 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() {
}
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.
I also took a picture to illustrate the these issues.
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!