Guten Tag,
zunächst möchte ich mit meiner Hardware beginnen:
RaspberryPi 3 B+
Aliexpress Capturecard (Karte auf Aliexpress)
Wemos D1 Mini Pro
Netzteil 5V; 10A
HyperHDR (Version 17.0.0)
Vor dem Austausch lief alles ohne Probleme und ohne Beanstandung, außer das Gelb nicht richtig Gelb war und Weiß immer so bläulich.
Weswegen mein eigentliches Anliegen entstand, dass ich meine WS2812b 60/m durch SK6812 RGBNW 30/m ausgetauscht habe. Vor dem Tausch habe ich gelesen, dass die die WS2812 einfach durch die SK6812, ohne große Veränderungen, ausgetauscht werden können. Also habe ich den Code auf die neue LED-Zahl reduziert, das LED Band am Fernseher geklebt, ohnes es vorher zu testen. Diesen Fehler werde ich wohl kein zweites mal machen..
An sich reagieren die LEDs auch entsprechend auf Informationen, die gesendet werden, ich kann diese auch ansprechen, in dem ich eine "Farbe" vorgebe, doch leider wird in keinster Weise eine Farbe dargestellt. Alles wird in Weiß dargestellt. Manche LEDs haben zwar farbe, aber nicht merkbar. Auch Leuchtet nicht der komplette Streifen auf. Meine erste Vermutung war, dass der LED-Streifen einen defekt aufweist, weswegen ich schnell ein Arduino geschnappt habe, dort ein Testprogramm von NEOPIXEL drauf gespielt habe und siehe da. Alles Leuchtet genau so, wie ich es mir wünsche. Hat jemand eine Vermutung, woran das liegen kann, dass die Farbe nicht richtig dargestellt wird?
ich habe zwei Quellcodes getestet, mit beiden ist die Farbdarstellung mit dem alten Band (ws2812b) korrekt und es leuchten alle LEDs, bei dem SK6812 Leuchtet alles, ein großer Teil der unteren LEDs.
Kann mir jemand weitere Tips geben, was das Problem sein könnte? Ich habe jetzt schon paar Stunden rumprobiert und komme leider zu keinem nennenswertem Ergebnis.
Code 1: https://github.com/hyperion-pr…ino/adalight/adalight.ino
Code 2:
#include "FastLED.h"
#define ANALOG_MODE_AVERAGE 0
#define ANALOG_MODE_LAST_LED 1
/**************************************
S E T U P
set following values to your needs
**************************************/
#define INITIAL_LED_TEST_ENABLED true
#define INITIAL_LED_TEST_BRIGHTNESS 32 // 0..255
#define INITIAL_LED_TEST_TIME_MS 500 // 10..
// Number of leds in your strip. set to "1" and ANALOG_OUTPUT_ENABLED to "true" to activate analog only
// As of 26/1/2017:
// 582 leaves ZERO bytes free and this
// 410 is ok
// tested with 500 leds and is fine (despite the warning)
#define MAX_LEDS 104
// type of your led controller, possible values, see below
#define LED_TYPE SK6812
// 3 wire (pwm): NEOPIXEL BTM1829 TM1812 TM1809 TM1804 TM1803 UCS1903 UCS1903B UCS1904 UCS2903 WS2812 WS2852
// S2812B SK6812 SK6822 APA106 PL9823 WS2811 WS2813 APA104 WS2811_40 GW6205 GW6205_40 LPD1886 LPD1886_8BIT
// 4 wire (spi): LPD8806 WS2801 WS2803 SM16716 P9813 APA102 SK9822 DOTSTAR
// For 3 wire led stripes line Neopixel/Ws2812, which have a data line, ground, and power, you just need to define DATA_PIN.
// For led chipsets that are SPI based (four wires - data, clock, ground, and power), both defines DATA_PIN and CLOCK_PIN are needed
// DATA_PIN, or DATA_PIN, CLOCK_PIN
#define LED_PINS D6 // 3 wire leds
//#define LED_PINS 6, 13 // 4 wire leds
#define COLOR_ORDER GRB // colororder of the stripe, set RGB in hyperion
#define OFF_TIMEOUT 15000 // ms to switch off after no data was received, set 0 to deactivate
// analog rgb uni color led stripe - using of hyperion smoothing is recommended
// ATTENTION this pin config is default for atmega328 based arduinos, others might work to
// if you have flickering analog leds this might be caused by unsynced pwm signals
// try other pins is more or less the only thing that helps
#define ANALOG_OUTPUT_ENABLED false
#define ANALOG_MODE ANALOG_MODE_LAST_LED // use ANALOG_MODE_AVERAGE or ANALOG_MODE_LAST_LED
#define ANALOG_GROUND_PIN 8 // additional ground pin to make wiring a bit easier
#define ANALOG_RED_PIN 9
#define ANALOG_GREEN_PIN 10
#define ANALOG_BLUE_PIN 11
// overall color adjustments
#define ANALOG_BRIGHTNESS_RED 255 // maximum brightness for analog 0-255
#define ANALOG_BRIGHTNESS_GREEN 255 // maximum brightness for analog 0-255
#define ANALOG_BRIGHTNESS_BLUE 255 // maximum brightness for analog 0-255
#define BRIGHTNESS 255 // maximum brightness 0-255
#define DITHER_MODE BINARY_DITHER // BINARY_DITHER or DISABLE_DITHER
#define COLOR_TEMPERATURE CRGB(255,255,255) // RGB value describing the color temperature
#define COLOR_CORRECTION TypicalLEDStrip // predefined fastled color correction
//#define COLOR_CORRECTION CRGB(255,255,255) // or RGB value describing the color correction
// Baudrate, higher rate allows faster refresh rate and more LEDs
//#define serialRate 460800 // use 115200 for ftdi based boards
//#define serialRate 115200 // use 115200 for ftdi based boards
#define serialRate 500000 // use 115200 for ftdi based boards
/**************************************
A D A L I G H T C O D E
no user changes needed
**************************************/
// Adalight sends a "Magic Word" (defined in /etc/boblight.conf) before sending the pixel data
uint8_t prefix[] = {'A', 'd', 'a'}, hi, lo, chk, i;
unsigned long endTime;
// Define the array of leds
CRGB leds[MAX_LEDS];
// set rgb to analog led stripe
void showAnalogRGB(const CRGB& led) {
if (ANALOG_OUTPUT_ENABLED) {
byte r = map(led.r, 0,255,0,ANALOG_BRIGHTNESS_RED);
byte g = map(led.g, 0,255,0,ANALOG_BRIGHTNESS_GREEN);
byte b = map(led.b, 0,255,0,ANALOG_BRIGHTNESS_BLUE);
analogWrite(ANALOG_RED_PIN , r);
analogWrite(ANALOG_GREEN_PIN, g);
analogWrite(ANALOG_BLUE_PIN , b);
}
}
// set color to all leds
void showColor(const CRGB& led) {
#if MAX_LEDS > 1 || ANALOG_OUTPUT_ENABLED == false
LEDS.showColor(led);
#endif
showAnalogRGB(led);
}
// switch of digital and analog leds
void switchOff() {
#if MAX_LEDS > 1 || ANALOG_OUTPUT_ENABLED == false
memset(leds, 0, MAX_LEDS * sizeof(struct CRGB));
FastLED.show();
#endif
showAnalogRGB(leds[0]);
}
// function to check if serial data is available
// if timeout occured leds switch of, if configured
bool checkIncommingData() {
boolean dataAvailable = true;
while (!Serial.available()) {
if ( OFF_TIMEOUT > 0 && endTime < millis()) {
switchOff();
dataAvailable = false;
endTime = millis() + OFF_TIMEOUT;
}
}
return dataAvailable;
}
// main function that setups and runs the code
void setup() {
Serial.begin(serialRate);
// analog output
if (ANALOG_OUTPUT_ENABLED) {
// additional ground pin to make wiring a bit easier
pinMode(ANALOG_GROUND_PIN, OUTPUT);
digitalWrite(ANALOG_GROUND_PIN, LOW);
pinMode(ANALOG_BLUE_PIN , OUTPUT);
pinMode(ANALOG_RED_PIN , OUTPUT);
pinMode(ANALOG_GREEN_PIN, OUTPUT);
}
int ledCount = MAX_LEDS;
if (ANALOG_OUTPUT_ENABLED == true && ANALOG_MODE == ANALOG_MODE_LAST_LED) {
ledCount--;
}
#if MAX_LEDS > 1 || ANALOG_OUTPUT_ENABLED == false
FastLED.addLeds(leds, ledCount);
#endif
// color adjustments
FastLED.setBrightness ( BRIGHTNESS );
FastLED.setTemperature( COLOR_TEMPERATURE );
FastLED.setCorrection ( COLOR_CORRECTION );
FastLED.setDither ( DITHER_MODE );
// initial RGB flash
#if INITIAL_LED_TEST_ENABLED == true
for (int v=0;v 1 || ANALOG_OUTPUT_ENABLED == false
FastLED.show();
#endif
#if ANALOG_OUTPUT_ENABLED == true
#if ANALOG_MODE == ANALOG_MODE_LAST_LED
showAnalogRGB(leds[MAX_LEDS-1]);
#else
showAnalogRGB(CRGB(sum_r/MAX_LEDS, sum_g/MAX_LEDS, sum_b/MAX_LEDS));
#endif
#endif
}
}
} // end of setup
void loop() {
// Not used. See note in setup() function.
}
Display More