I am building a neopixel display using a Teensy 3.6 coupled to a SN74AHCT125 to boost the data voltage to 5v. I am using bare sk6812 neopixels which have to be soldered. Before I install the soldered neopixels, I use the following sketch to test each one. This sketch does not run the neopixels smoothly. Instead there seems to be random hesitations of varying length of up to a second or two. I ran the sketch on a Uno. There were no hesitations. The voltage booster has 4 channels. It doesn't make a difference if I change channels. It doesn't make any difference if I exclude the use of the voltage booster altogether.
Here's the sketch:
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
// the first NeoPixel is 0, second is 1
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NUMPIXELS 1
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int x; // utility variable
int r; int g; int b;// red,blue,green
int p; // pixel number
int n=NUMPIXELS;
void setup() {
Serial.begin(9600);
pixels.begin(); // This initializes the NeoPixel library.
}
void loop() {
x=0;
while(x<n){
on(x,50,0,0);
delay(500);
off(x);
on(x,0,50,0);
delay(500);
off(x);
on(x,0,0,50);
delay(500);
off(x);
x++;
}
}
void on(int p, int r, int g, int b){
pixels.setPixelColor(p, pixels.Color(r,g,b));
pixels.show();
}
void off (int p){
pixels.setPixelColor(p, pixels.Color(0,0,0));
pixels.show();
}
void alloff(){
x=0;
while(x<100){ off(x);x++;}
}
Any suggestions?
Richard Brewer
r2pbrewer@yahoo.com
Here's the sketch:
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
// the first NeoPixel is 0, second is 1
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NUMPIXELS 1
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int x; // utility variable
int r; int g; int b;// red,blue,green
int p; // pixel number
int n=NUMPIXELS;
void setup() {
Serial.begin(9600);
pixels.begin(); // This initializes the NeoPixel library.
}
void loop() {
x=0;
while(x<n){
on(x,50,0,0);
delay(500);
off(x);
on(x,0,50,0);
delay(500);
off(x);
on(x,0,0,50);
delay(500);
off(x);
x++;
}
}
void on(int p, int r, int g, int b){
pixels.setPixelColor(p, pixels.Color(r,g,b));
pixels.show();
}
void off (int p){
pixels.setPixelColor(p, pixels.Color(0,0,0));
pixels.show();
}
void alloff(){
x=0;
while(x<100){ off(x);x++;}
}
Any suggestions?
Richard Brewer
r2pbrewer@yahoo.com