Hi there, i tried out you octo lib and have the following problem (btw, thx 4 this lib) with 2812B LEDs:
every LED is addressable, except of the second one (address #1). First i connected the teensy 3.5 without a level converter, just to test the library. Then i thought, the problem is because of a bad data signal or a damaged LED.
I tested 4 stripes, all have the second LED bug. A level converter to 5V didn't solve the problem, so i thought, i should be a software problem.
Also i tried out to change the configuration to WS2813_800kHz - no success.
Is the Octo2811 lib fully compatible to the teensy 3.5?
greetings!
here the code:
Edit: of course i searched for similar posts, but didn't really find a solution.
every LED is addressable, except of the second one (address #1). First i connected the teensy 3.5 without a level converter, just to test the library. Then i thought, the problem is because of a bad data signal or a damaged LED.
I tested 4 stripes, all have the second LED bug. A level converter to 5V didn't solve the problem, so i thought, i should be a software problem.
Also i tried out to change the configuration to WS2813_800kHz - no success.
Is the Octo2811 lib fully compatible to the teensy 3.5?
greetings!
here the code:
Code:
#include<SD.h>
#include <SPI.h>
#include <OctoWS2811.h>
//Frame settings
unsigned char fps = 1;
unsigned long frameTime = 1000 / fps;
//SD_Card:
#define fileName "myanim.dat"
File file;
const int chipSelect = BUILTIN_SDCARD;
// OctoWS2811 settings
const int ledsPerStrip = 529; // change for your setup
const byte numStrips= 1; // change for your setup
const int numLeds = ledsPerStrip * numStrips;
const int numberOfChannels = numLeds * 3; // Total number of channels you want to receive (1 led = 3 channels)
DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];
const int config = WS2811_GRB | WS2813_800kHz;
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);
char red = 0;
char green = 0;
char blue = 0;
bool dirRed = 1;
bool dirGreen = 0;
bool dirBlue= 0;
void setup()
{
Serial.begin(9600);
while(!Serial){
; // wait for serial port to connect.
}
Serial.print("\n Initializing SD card...");
if(!SD.begin(chipSelect)){
Serial.print("initialization failed!");
return;
}
Serial.println("initalization done.");
//init led-prog and test connected strips
leds.begin();
initTest();
delay(2000);
}
void loop()
{
for (int i = 0; i<numLeds; i++){
leds.setPixel(i, red, green, blue);
}
[COLOR="#B22222"]leds.setPixel(2, 177, 0, 177); // <-- second LED lights too[/COLOR]
[COLOR="#B22222"]leds.setPixel(1, 177, 0, 177); // <-- no reaction of LED 1, always goes with LED 2[/COLOR]
leds.show();
incColor();
delay(50);
}
void incColor(){
if (dirRed){
red++;
if (red == 80) dirRed = 0;
} else {
red--;
if (red == 0) dirRed = 1;
}
}
void getNextFrame(){
unsigned char color[3];
//open file
file = SD.open(fileName, FILE_READ);
for(unsigned int i = 0; i < ledsPerStrip; i++){
file.read(color, 3);
Serial.print("Pixel: ");
Serial.println(i, DEC);
Serial.print("RED...");
Serial.println(color[0], HEX);
Serial.print("GREEN...");
Serial.println(color[1], HEX);
Serial.print("BLUE...");
Serial.println(color[2], HEX);
Serial.println(" ");
leds.setPixel(i, color[0], color[1], color[2]);
}
Serial.println(file.position(), 10);
file.close();
// leds.show();
}
void initTest()
{
for (int i = 0 ; i < numLeds ; i++)
leds.setPixel(i, 80, 0, 0);
leds.show();
delay(500);
for (int i = 0 ; i < numLeds ; i++)
leds.setPixel(i, 0, 80, 0);
leds.show();
delay(500);
for (int i = 0 ; i < numLeds ; i++)
leds.setPixel(i, 0, 0, 80);
leds.show();
delay(500);
for (int i = 0 ; i < numLeds ; i++)
leds.setPixel(i, 0, 0, 0);
leds.show();
}
Edit: of course i searched for similar posts, but didn't really find a solution.