I followed the schematic in the examples for the NeoPixels to invert the signal. I have them hooked up and can produce some colors on the NeoPixel strip, however, the colors are not associated with pixel 1, pixel 2 and so forth. They appear to overlap, perhaps having the wrong buffer length per pixel? I have 4, triple color NeoPixels and here is the example code I am using:
#include "ZUNO_NeoPixel.h"
#define MAX_PIXELS 4 // NB! Z-Uno can not control more than 25 WS2811 without harming RF communications
#define PIXEL_SIZE 3 // Three colors per pixel
#define BUFF_SIZE (MAX_PIXELS * PIXEL_SIZE)
byte pixel_buff[BUFF_SIZE];
NeoPixel pixels(pixel_buff, BUFF_SIZE);
void setup() {
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
pixels.clear(); // Set all pixel colors to 'off'
}
void loop() {
for(int i=0; i<254; i++) {
pixels.setPixelColor(1, pixels.Color(i, 0, 0));
delay(10);
pixels.show();
}
for(int i=0; i<254; i++) {
pixels.setPixelColor(1, pixels.Color(0, i, 0));
delay(10);
pixels.show();
}
for(int i=0; i<254; i++) {
pixels.setPixelColor(1, pixels.Color(0, 0, i));
delay(10);
pixels.show();
}
pixels.clear();
delay(5000);
}
With this code, the second pixel on the strip goes red, then blue, and then the third pixel goes green when it should only be modifying the second pixel. Also, the pixels.clear(); doesn't clear the first pixel if a color has been put on that. Is there something I can change or some other place to define the buffer?
NeoPixel library not outputting correctly
Re: NeoPixel library not outputting correctly
This was for the Z-Uno G1. When trying to run the example for G2 I get:
'NeoPixel' does not name a type
'NeoPixel' does not name a type
Re: NeoPixel library not outputting correctly
Hi,
The API has changed since the first version. Now the library supports the ability to work with several tapes at once. Try the examples that come with the Z-Uno core (see the screenshot). Good luck.
Best regards,
Alex.
The API has changed since the first version. Now the library supports the ability to work with several tapes at once. Try the examples that come with the Z-Uno core (see the screenshot). Good luck.
Best regards,
Alex.
- Attachments
-
- SCNeo.png (203.86 KiB) Viewed 1915 times
Re: NeoPixel library not outputting correctly
Thanks, the example works for the G2