mh niemand? dann werd ich einfach mal testen
Beiträge von kerbone
-
-
Huhu, bin gerade auf der Suche in meinem laufendem YaVDR System noch Steam einzubinden.
Zusätzlich wollte ich noch einen vorhandenen PS3 Controller anbinden ( Dies sollte ohne weiteres machbar sein, meiner Recherche nach)Geht das so ohne weiteres ? Meines Wissens nach gibt es ja einen Steam-Linux Client. Nur das einbinden stelle ich mir momentan nicht gerade einfach vor?
Hat diese Kombination evtl. schon jemand am laufen und mag mir ein wenig unter die Arme greifen?Lg
-
@ TheChief:
dank UweHeinritz funktioniert bei mir nun auch XBMC erfolgreich. Anbei mal ein Zitat aus einer PN:CodeDas Prefix muss zwingend zu dem im Arduino-Prohejt (sicher tpm2arduino) passen. Das setzt sich zusammen aus C9 (tmp2Start), DA (tpm2DataFrame) und dem High und Low Byte der LED Anzahl zusammen.Bei meiner boblight.conf steht darum C9 DA 02 70 im Header (die 270 ist HEX für 624 Kanäle = 208 LEDs). Du musst bei dir also folgendes im Header stehen haben (für 175 LEDs * 3 = 525 Kanäle = 02 0D als HEX): channels 175 type momo Intervall 60000 prefix C9 DA 02 0D postfix 36 rate 500000
Den Rest der boblight.conf hab ich mit dem Windowstool erstellt.Echt ein leidiges Thema das man da so schlecht Infos drüber findet.
@ Copperhead, ich hab LED´s unten trotz Standfuß. Finde es wirkt schon sehr gut und wenn man eh 4 Meter bestellt auch kein Problem.
Ich habe an der Rückwand auch eine art Wölbung -> schwarze Kunststoff Platte zugeschnitten und die Led´s drauf geklebt. Die Platte mit doppelseitigem Klebeband
am TV fixiert. Somit bleibt die Konstruktion auch ein wenig "flexibel" und man kann Unebenheiten ausgleichen. Anbei noch ein paar Bilder.
Zum Thema mit der Intensität in XBMC -> Mir gefällt es das man die Unterschiede der einzelnen Farben (Vokalem bei Gelbtönen) viel besser sieht wie im Sedu Plugin. Bin daher am überlegen ob ich komplett auf XBMC Frontend wechseln soll. -
So kurzes update, nun läuft alles wunderbar. Vielen Dank für die Unterstützung.
Was mich derzeit noch ein wenig stört ist das weiß ein wenig blau dargestellt wird, muss ich da an den % Werten der Farbkanäle im seduplugin spielen damit ich das abgeglichen bekomme oder?
Könntest du mir evtl. mal noch deine Boblight Config (Zumindest den Header) zu kommen lassen, weil da hapert es ganz schön noch. -
ja hab ichgrad auch gemacht und wohl einen Kurzschluss erzeugt (Nur noch ein Streifen leuchtete) - nun hab ich wirklich alles neu gelötet und gesteckt. sieht wieder gut aus.
Nun muss ich wieder neu montieren- echt krass was für ein Aufwand da nötig ist... -
Ok dann belästige ich mal die junge in dem Thread.
Nun hab ich wieder Diskomodus - also wahrscheinlich iwo ne schlechte Lötstelle oder? Kann es auch mit meiner usbkabel Verlängerung zu tun haben? -
Yeah vielen Dank. Bei YaVdr steht unten rechts beim umschalten des jeweiligen Kanals ob er Stereo oder Mono ist und welche Auflösung dieser bringt in rot. War ein wenig spät gestern
Nun fehlt egt. nur noch die Anbindung an XBMC -> hab ich es richtig verstanden:-Boblight Plugin für XBMC und das Boblight-Xserver Plugin im VDR installieren? Gibt es da eine gute Anleitung?
-
in var/lib/vdr/plugins/seduatmo/
Jo habe gefunden dann
Danke dir@The Chief -> hab nun alles angepasst und installiert.
Nun flackert der atmo Effekt aber teilweise echt stark (erinnert an einen Disco Mode) und eine"saubere" eckerkennung kann ich ich auch nicht ausmachen. Als ich alle 240 LED´s angesprochen habe hat es iwie viel smoother und direkt gearbeitet. (Stereo Auflösungsanzeige etc haben unten rechts immer richtig genau rot aufgeleuchtet)Was mich auch wundert das fixed color auch teilweise die Helligkeit sich auf einem streifen sporadisch ändert?
Ok der Diskomodus ist weg, habe nur 1mal 5v und Gnd angeschlossen dann hat es aufgehört
Aber ganz zufrieden bin ich noch nicht.Die Abstufung ist iwie nicht so stark - liegt das am smoothness wert? Könnte mal jemand seine Einstellungen aus dem Plugin (Also der Config und im VDR Plugin selbst) posten? -
Hi,
habe nun die LED´s am TV und auch erfolgreich getestet. Als es noch alle LED´s waren konnte ich ohne Probleme die Ansteuerung via Plugin durchführen. Nun hab ich die Software auf meine Anzahl angepasst (184) und neu geflasht..
Nun hab ich im /var/lib/vdr/plugins/seduatmo/seduatmo.conf neu angelegt.
Gibt es sonst noch Einstellungen die "wichtig" wären? Also evtl direkt im Plugin etc?
Danke -
Ok dann melde ich mich sobald alles am TV ist, das Skript hab ich übrigens schon durchlaufen lassen, wahrscheinlich fehlt noch dem vdr die Möglichkeit auf das dev zuzugreifen (Udev Regel ist aber auch schon vorhandne).
Edit:
Problem lag daran:
musste unter: /etc/udev/rules.d
/ Folgende Regel anlegen:99-sedu-board.rules
KERNEL=="ttyUSB?", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", SYMLINK+="ttySEDU"Keine Ahnung warum die Udev unter /lib/udev/rules.d/99-sedu-board.rules
nicht gezogen hat.
Nun geht alles soweit. Montieren und gut ist. Evtl. melde ich mich nochmal wegen Einstellungen / XBMC etc - sollte da was aufkommen.
Vielen Dank ! -
jo das geht, also er fadet nun alle Farben durch.
Für das Plugin muss ich wieder auf 0 stellen oder? -
Folgende hab ich gekauft: http://www.aliexpress.com/item…50-smd-rgb/633124138.html
Je nachdem welche WS2811 ich auskommentiere habe ich andere Effekte - leider nie ein Atom Effekt.
-
Ja habe das hier auskommtetiert:
void setup()
{
FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(data.rgb, NUM_LEDS);Oder müssen es die Neopixel sein?
Wie gesagt er steuert ja die leds an, aber eben nicht kontinuierlich - es blinkt nur -
Stimmt, wenn ich das mache blinkt der led streifen (noch nichts getrennt) 1x kurz in verschiedenen Farben auf.
Hab nun mal folgendes auf der Ardunio aufgespielt: 4 Meter LED´s 4* 60 = 240 St -> bin zu faul um zu zählen.Code
Alles anzeigen#include <pt.h>#define FORCE_SOFTWARE_SPI#define FORCE_SOFTWARE_PINS#include "FastSPI_LED2.h" /*==============================================================================*//* LED und Arduino Variablen *//*==============================================================================*/ #define NUM_LEDS 240 // Number of LEDs#define MAX_ARGS 10 // Max Number of command arguments#define BAUDRATE 500000 // Baudrate#define SERIAL Serial // Serial port for communication#define SERIAL_DEBUG Serial // Serial port for debugging#define DATA_PIN 3 // PIN where LEDs are connected/Used for TM1809/WS2811 chipsets, because they dont use SPI//#define CLOCK_PIN 4 // used for some SPI chipsets, e.g. WS2801 #define BRIGHTNESS 255 // define global brightness 0..250 //choose your LED chipset in void setup() /*==============================================================================*//* TPM2 Variablen *//*==============================================================================*/ enum Protocol{ // positions posStart = 0, posType = 1, posFsHigh = 2, posFsLow = 3, posData = 4, // bytes tpm2Start = 0xc9, tpm2DataFrame = 0xda, tpm2Command = 0xc0, tpm2Answer = 0xaa, tpm2End = 0x36, tpm2Ack = 0xAC}; enum Mode{ mNone, mCommunication, mProgram}; struct Data{ int pos; uint8_t type; uint16_t fs; uint8_t command; CRGB rgb[NUM_LEDS];} data; byte args[MAX_ARGS];unsigned long lastDataAt = 0;int program = 0; int mode = mNone;int effectDelay = 100;static struct pt pt1; /*==============================================================================*//* Variablen für Effekte *//*==============================================================================*/ int BOTTOM_INDEX = 0;int TOP_INDEX = int(NUM_LEDS/2);int EVENODD = NUM_LEDS%2; /*==============================================================================*//* debug code/*==============================================================================*/ // comment this line out to disable debugging //#define DEBUG #ifdef DEBUG void debug(const char* str){ SERIAL_DEBUG.println(str);} void debug(const char* str, uint16_t val, int fmt = DEC){ SERIAL_DEBUG.print(str); SERIAL_DEBUG.println(val, fmt);} int freeRam() { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); } #else# define debug( ... ) #endif void setup(){ memset(data.rgb, 0, sizeof(struct CRGB) * NUM_LEDS); // Uncomment one of the following lines for your leds arrangement. // FastLED.addLeds<TM1803, DATA_PIN, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<TM1804, DATA_PIN, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<TM1809, DATA_PIN, RGB>(data.rgb, NUM_LEDS); // FastSPI_LED2.addLeds<WS2811, DATA_PIN, GRB>(data.rgb+18, NUM_LEDS/3); // FastLED.addLeds<WS2811, 8, RGB>(data.rgb + 225, NUM_LEDS/4); // FastLED.addLeds<WS2812, DATA_PIN, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<WS2812B, DATA_PIN, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<NEOPIXEL, DATA_PIN, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<WS2801, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<SM16716, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<LPD8806, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(data.rgb, NUM_LEDS); // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(data.rgb, NUM_LEDS); FastLED.addLeds<WS2811, DATA_PIN, GRB>(data.rgb, NUM_LEDS); FastLED.setBrightness(BRIGHTNESS); oneColorAll(10,10,10);#ifdef DEBUG SERIAL_DEBUG.begin(BAUDRATE); // wait for serial port to connect. Needed for Leonardo only while (!Serial) delay(1); SERIAL_DEBUG.println("Setup done");#endif SERIAL.begin(BAUDRATE); memset(args, 0, MAX_ARGS); PT_INIT(&pt1); resetVars();} /*==============================================================================*//* Thread für Programm/Effekte/*==============================================================================*/ static int playProgramThread(struct pt *pt) { static unsigned long timestamp = 0; PT_BEGIN(pt); while(1) { PT_WAIT_UNTIL(pt, millis() - timestamp > effectDelay); playProgram(); timestamp = millis(); } PT_END(pt);} /*==============================================================================*//* loop/*==============================================================================*/ void loop(){ while (1) { // if data available switch to communication mode if (SERIAL.available() > 0) { if (mode != mCommunication) { debug("switching to communication mode"); mode = mCommunication; resetVars(); } doCommunication(); } else // communication timeout after 0.5 seconds while (SERIAL.available() == 0 && millis()-lastDataAt > 1000) { if (mode != mProgram) { debug("switching to prg mode, ignoring ", data.pos); mode = mProgram; resetVars(); } playProgramThread(&pt1); } }} /*==============================================================================*//* do communication/*==============================================================================*/ void doCommunication(){#ifdef DEBUG int count = 0;#endif // read ... while (SERIAL.available() > 0) { byte val = SERIAL.read(); lastDataAt = millis(); #ifdef DEBUG debug("got: ", val, HEX); debug("at pos: ", data.pos, DEC); count++;#endif if (data.pos == posStart && val == tpm2Start) // Startbyte resetVars(); else if (data.pos == posType && (val == tpm2DataFrame || val == tpm2Command)) // Block-Art data.type = val; else if (data.pos == posFsHigh) // Framesize (High Bit) { data.fs = (val << 8) & 0xFF00; if (data.fs > NUM_LEDS*3) { debug("framsize too high: ", data.fs); resetVars(); continue; } } else if (data.pos == posFsLow) // Framesize (Low byte) { data.fs += val & 0x00FF; if (data.fs > NUM_LEDS*3) { debug("framsize too high: ", data.fs); resetVars(); continue; } } else if (data.pos == posData + data.fs && val == tpm2End) // End Byte parsePacket(); else if (data.pos >= posData && data.pos < posData+data.fs) // Bytes zwischen Header und Ende lesen evaluateData(val); else // protocol violation ... { if (data.pos != 0) { debug("protocol violation at pos: ", data.pos); debug("val was: ", val); } debug("Error"); resetVars(); continue; } data.pos++; } #ifdef DEBUG if (count) debug("received", count, DEC);#endif} /*==============================================================================*//* evaluate data/*==============================================================================*/ void evaluateData(byte val){ if (data.type == tpm2DataFrame) // frame data { uint8_t* rgb = (uint8_t*)data.rgb; rgb[data.pos-posData] = val; } else // command data { if (data.pos == posData) { data.command = val; memset(args, 0, sizeof(args)); } else args[data.pos-posData-1] = val; }} /*==============================================================================*//* reset variables/*==============================================================================*/ void resetVars(){ debug("Reset"); memset(&data, 0, sizeof(Data)); //data.rgb = (struct CRGB*)FastSPI_LED.getRGBData(); memset(data.rgb, 0, NUM_LEDS * sizeof(struct CRGB));} /*==============================================================================*//* parse packet/*==============================================================================*/ void parsePacket(){ debug("Parse"); switch (data.type) { case tpm2DataFrame: { showLeds(); break; } case tpm2Command: { setProgram(); break; } default: break; } SERIAL.write(tpm2Ack); SERIAL.flush(); resetVars(); data.pos = -1;} /*==============================================================================*//* set LED color/*==============================================================================*/ void setLedColor(int led, uint8_t r, uint8_t g, uint8_t b){ data.rgb[led].r = r; data.rgb[led].g = g; data.rgb[led].b = b; } /*==============================================================================*//* one Color All/*==============================================================================*/ void oneColorAll(uint8_t r, uint8_t g, uint8_t b){ memset(data.rgb, 0, NUM_LEDS * sizeof(struct CRGB)); for (int led = 0; led < NUM_LEDS; led++) setLedColor(led, r, g, b); showLeds(); effectDelay = 1000;} /*==============================================================================*//* Output Leds/*==============================================================================*/ void showLeds(){ FastLED.show();} void setProgram(){ program = data.command;} void playProgram(){ switch (program) { case 0: oneColorAll(args[0],args[1],args[2]); break; case 1: loopRGBPixel(50); break; case 2: rainbow_fade(20); break; case 3: rainbow_loop(20); break; case 4: random_burst(20); break; case 5: flicker(200,1); break; case 6: colorBounce(200,50); break; case 7: pulse_oneColorAll(200,50,100,0); break; case 8: pulse_oneColorAll(0,50,100,1); break; case 9: police_light_strobo(50); break; case 10: police_lightsALL(20); break; case 11: police_lightsONE(20); break; /*case 12: sin_bright_wave(20,50); break; case 13: wave(100);break;*/ default: oneColorAll(0,0,0); break; }} /* Set LED Color of given LED */ void oneColorAllNOSHOW(int r, int g, int b){ resetVars(); for (int led = 0; led < NUM_LEDS; led++) { setLedColor(led, r, g, b); } } /*==============================================================================*//* Effect 0: Fixed color - Arguments RR GG BB/*==============================================================================*/ /*==============================================================================*//* Effect 1: Loops each RGB color through each Pixel/*==============================================================================*/ void loopRGBPixel(int idelay) //OK{ static int c = 0; static int i = 0; if (i > NUM_LEDS-1) { i = 0; c++; } if (c == 3) c = 0; memset(data.rgb, 0, NUM_LEDS*3); switch (c) { case 0: data.rgb[i].r =200; break; case 1: data.rgb[i].g =200; break; case 2: data.rgb[i].b =200; break; } showLeds(); effectDelay = idelay; i++;} /*==============================================================================*//* Effect 2: Fade through raibow colors over all LEDs/*==============================================================================*/ void rainbow_fade(int idelay) { //OK //-FADE ALL LEDS THROUGH HSV RAINBOW static int ihue = -1; ihue++; if (ihue >= 359) { ihue = 0; } int thisColor[3]; hsv2rgb(ihue, 1, 1, thisColor); for(int idex = 0 ; idex < NUM_LEDS; idex++ ) { setLedColor(idex,thisColor[0],thisColor[1],thisColor[2]); } showLeds(); effectDelay = idelay;} /*==============================================================================*//* Effect 3: Loops rainbow colors around the stripe/*==============================================================================*/ void rainbow_loop(int idelay) { //-LOOP HSV RAINBOW static double idex = 0; static double ihue = 0; int icolor[3]; double steps = (double)360/NUM_LEDS; for(int led = 0 ; led < NUM_LEDS; led++ ) { ihue = led * steps + idex; if (ihue >= 360) ihue -= 360; hsv2rgb(ihue, 1, 1, icolor); setLedColor(led, icolor[0], icolor[1], icolor[2]); if (led == 0) idex += steps; if (idex >= 360) idex = 0; } showLeds(); effectDelay = idelay;} /*==============================================================================*//* Effect 4: Random burst - Randowm colors on each LED/*==============================================================================*/ void random_burst(int idelay) { //-RANDOM INDEX/COLOR static int idex = 0; static int ihue = 0; int icolor[3]; idex = random(0,NUM_LEDS-1); ihue = random(0,359); hsv2rgb(ihue, 1, 1, icolor); setLedColor(idex, icolor[0], icolor[1], icolor[2]); showLeds(); effectDelay = idelay;} /*==============================================================================*//* Effect 5: Flicker effect - random flashing of all LEDs/*==============================================================================*/ void flicker(int thishue, double thissat) { int random_bright = random(0,100); double ibright = (double)random_bright/100; int random_delay = random(10,100);// int random_bool = random(0,random_bright); int thisColor[3]; //if (random_bool < 10) { hsv2rgb(thishue, thissat, ibright, thisColor); for(int i = 0 ; i < NUM_LEDS; i++ ) { setLedColor(i, thisColor[0], thisColor[1], thisColor[2]); } showLeds(); effectDelay = random_delay; //}} /*==============================================================================*//* Effect 6: Color bounce - bounce a color through whole stripe/*==============================================================================*/ void colorBounce(int ihue, int idelay) { //-BOUNCE COLOR (SINGLE LED) static int bouncedirection = 0; static int idex = 0; int color[3]; hsv2rgb(ihue, 1, 1, color); if (bouncedirection == 0) { idex = idex + 1; if (idex == NUM_LEDS) { bouncedirection = 1; idex = idex - 1; } } if (bouncedirection == 1) { idex = idex - 1; if (idex == 0) { bouncedirection = 0; } } for(int i = 0; i < NUM_LEDS; i++ ) { if (i == idex) { setLedColor(i, color[0], color[1], color[2]); } else { setLedColor(i, 0, 0, 0); } } showLeds(); effectDelay = idelay;} /*==============================================================================*//* Effect 7/8: Fade in/out a color using brightness/saturation/*==============================================================================*/ void pulse_oneColorAll(int ahue, int idelay, int steps, int useSat) { //-PULSE BRIGHTNESS ON ALL LEDS TO ONE COLOR static int bouncedirection = 0; static int idex = 0; double isteps = (double)1/steps; static double ival = 0; static int xhue = 0; if (bouncedirection == 0) { ival += isteps; if (ival >= 1) { bouncedirection = 1; } } if (bouncedirection == 1) { ival -= isteps; if (ival <= 0) { bouncedirection = 0; xhue = random(0, 359); } } int acolor[3]; if (useSat == 0) hsv2rgb(xhue, 1, ival, acolor); else hsv2rgb(xhue, ival, 1, acolor); for(int i = 0 ; i < NUM_LEDS; i++ ) { setLedColor(i, acolor[0], acolor[1], acolor[2]); } showLeds(); effectDelay = idelay;} /*==============================================================================*//* Effect 9: Police light - red/blue strobo on each half of stripe/*==============================================================================*/ void police_light_strobo(int idelay){ int middle = NUM_LEDS/2; static int color = 0; static int left_right = 0; if (left_right > 19) left_right = 0; if (color == 1) color = 0; else color = 1; for (int i = 0; i < NUM_LEDS; i++) { if (i <= middle && left_right < 10) { if (color) setLedColor(i, 0, 0, 255); else setLedColor(i, 0, 0, 0); } else if (i > middle && left_right >= 10) { if (color) setLedColor(i, 255, 0, 0); else setLedColor(i, 0, 0, 0); } } showLeds(); effectDelay = idelay; left_right++; } /*==============================================================================*//* Effect 10: Police Light all LEDs /*==============================================================================*/ void police_lightsALL(int idelay) { //-POLICE LIGHTS (TWO COLOR SOLID) static int idex = 0; int idexR = idex; int idexB = antipodal_index(idexR); setLedColor(idexR, 255, 0, 0); setLedColor(idexB, 0, 0, 255); showLeds(); effectDelay = idelay; idex++; if (idex >= NUM_LEDS) { idex = 0; }} /*==============================================================================*//* Effect 11: Police Light one LED blue and red/*==============================================================================*/ void police_lightsONE(int idelay) { //-POLICE LIGHTS (TWO COLOR SINGLE LED) static int idex = 0; int idexR = idex; int idexB = antipodal_index(idexR); for(int i = 0; i < NUM_LEDS; i++ ) { if (i == idexR) { setLedColor(i, 255, 0, 0); } else if (i == idexB) { setLedColor(i, 0, 0, 255); } else { setLedColor(i, 0, 0, 0); } } showLeds(); effectDelay = idelay; idex++; if (idex >= NUM_LEDS) { idex = 0; }} /*==============================================================================*//* Effect 12: Sinus Wave on LEDs FIX/*==============================================================================*/ void sin_bright_wave(int ahue, int idelay) { int acolor[3]; double tcount = 0.0; double ibright = 0.0; static double idex = 0.0; for(int i = 0; i < NUM_LEDS; i++ ) { if (i == 0) idex += 0.1; tcount = tcount + .1 + idex; if (idex > 3.14) idex = 0; if (tcount > 3.14) tcount = 0.0; ibright = sin(tcount) + idex; hsv2rgb(ahue, 1, ibright, acolor); data.rgb[i].r = acolor[0]; data.rgb[i].g = acolor[1]; data.rgb[i].b = acolor[2]; } showLeds(); effectDelay = idelay;} /*==============================================================================*//* Effect 12: Wave on LEDs FIX/*==============================================================================*/ void wave(int idelay) { int wavesize = NUM_LEDS/8; //60 int waveheight = wavesize/2; //30 double steps = (double)1/waveheight; //0,0333333 double start = 0.00; static double offset = 0.00; int colors[3]; int dir = 1; for (int i = 0; i < NUM_LEDS; i++) { hsv2rgb(0, 1, start, colors); setLedColor(i, colors[0], colors[1], colors[2]); if (i == 0 && dir == 1) start += offset; else if (i == 0 && dir == 0) start -= offset; if (dir == 1) start += steps; if (dir == 0) start -= steps; if (start >= 1) dir = 0; if (start <= 0) dir = 1; } /*offset += steps; if (offset > 0.5 ) offset = 0;*/ showLeds(); effectDelay = idelay;} /*==============================================================================*//* Util func Effekte *//*==============================================================================*/ //-CONVERT HSV VALUE TO RGBvoid hsv2rgb(double h, double s, double v, int colors[3]){ double rr = 0; double gg = 0; double bb = 0; int i = floor(h/60.0); double f = h/60.0 - i; double pv = v * (1 - s); double qv = v * (1 - s * f); double tv = v * (1 - s * (1-f)); switch (i) { case 0: // rojo dominante rr = v; gg = tv; bb = pv; break; case 1: // verde rr = qv; gg = v; bb = pv; break; case 2: rr = pv; gg = v; bb = tv; break; case 3: // azul rr = pv; gg = qv; bb = v; break; case 4: rr = tv; gg = pv; bb = v; break; case 5: // rojo rr = v; gg = pv; bb = qv; break; } // set each component to a integer value between 0 and 255 colors[0] = minMax(255*rr, 0, 255); colors[1] = minMax(255*gg, 0, 255); colors[2] = minMax(255*bb, 0, 255);} void rgb2hsv(int r, int g, int b, double h, double s, double v){ double minC, maxC, delta, rc, gc, bc; rc = (double)r / 255.0; gc = (double)g / 255.0; bc = (double)b / 255.0; maxC = max(rc, max(gc, bc)); minC = min(rc, min(gc, bc)); delta = maxC - minC; v = maxC; if (maxC != 0) s = delta / maxC; else s = 0; if (s == 0) { h = 0; } else { if (rc == maxC) h = (gc - bc) / delta; else if (gc == maxC) h = 2 + (bc - rc) / delta; else if (bc == maxC) h = 4 + (rc - gc) / delta; h *= 60.0; if (h < 0) h += 360.0; }} int minMax(int x, int min, int max){ if (x < min) return min; if (max < x) return max; return x;} //-FIND INDEX OF ANTIPODAL OPPOSITE LEDint antipodal_index(int i) { //int N2 = int(NUM_LEDS/2); int iN = i + TOP_INDEX; if (i >= TOP_INDEX) { iN = ( i + TOP_INDEX ) % NUM_LEDS; } return iN;}
Anschließend hab ich via apt-get install vdr-plugin-seduatmo installiert.
Nach Neustart ist im VDR das Plugin verfügbar. Nun hab ich auf GND das Weiße Kabel vom LED Strip auf das GND des Arduino. Das Grüne/Schwarze Kabel hab ich auf Pin 3 des Arduino gesteckt. Anschließend so wie du vorgeschlagen hast die LEDs an Netzteil. Innen Rot (+) aussen Weiß GND. Nun Blinkt es weiß, dann kurz in allen Farben dann wieder in weiß. Wie kann ich dem Addon nun sagen welcher Effekt gestartet werden soll? Im VDR OSD hab ich Rainbow ausgewählt - keine Änderung.
Ansteuerung scheint aber dennoch zu funktionieren: echo -n -e "\xc9\xc0\x00\x01\x01\x36" >/dev/ttyUSB0
kurzes ca 2sek weißes aufleuchten der LEDsok das test.c file wo du erwähnt hast läuft auch. Also muss irgendwas mit der pluginsteuerung zwischen ardunio und seduplugin nicht stimmen?
-
Wenn ich das richtig sehe, sieht es so aus:
Weiss = GND
Rot = +5V
Schwarz = DatenIch würd dir empfehlen, die Kabel abzulöten und Rot für +5 V und Schwarz für GND zu nehmen. Führt nur zu Verwirrung.
Ansonsten 5V und GND der Strippe ans Netzteil, am Anfang und am Ende oder am Anfang und in der Mitte nochmal einspeisen.
DI geht zum Arduino, ebenso GND zum Arduino GND Pin.
Solange Du keine 12V anschliesst, dürfte nichts passieren. Aber am besten gleich richtig verkabeln
Ok dann hab ich es verstanden. Ohne Kupplung geht ja noch nichts - wenn die da ist geht es weiter. Meinen Arduino hab ich schon zum laufen gebracht Werde nun deine FW drauf packen.
Vielen dank mal soweit! -
Hallo The Chief,
habe nun alles ausser die Hohlkupplung.
Wollte vorab mal anfragen weil iwie sehen meine LED´s anders aus - ich habe 5 Kabel an beiden enden. Irgendwie verstehe ich gerade nicht wie ich das ganze verkablen muss.
Bei deinem Testaufbau sieht man das du in der Hohlkupplung 4 Kabel angeschlossen hast. Ist das der Anfang und Ende des LED Strips jeweils das 5v+ und GND?
An den Ardunio kommen nur Datenleitung (Bei mir Grün?) und GND(Bei mir weiß?) D.h: dann im Endeffekt das ich aus dem Stecker die Rote Leitung nicht anschließe da diese über die andere direkte Rote Leitung kommt?
Kann etwas zerstört werden sollte ich es falsch anschließen?
Bin wahrscheinlich ein wenig zu optimistisch an das Projekt ran und blick nun nicht so durch wie ich sollte =/
Sorry für meine Unbeholfenheit.
Anbei mal ein Bild meiner LEDS
Liebe Grüße -
Ok vielen Dank
-
Hey hey wie angekündigt hab ich mir auch mal die Hw bestellt.
Leider hab ich mit Ardunio keinerlei Erfahrung. Das löten etc. müsste ich hinbekommen. Was mir momentan nicht ganz klar ist, wie arbeitet der ardunio mit dem Vdr? Ich flashe deinen Quelltext auf das Ardunio und zum ansteuern kann ich einfach das atmolight plugin dafür verwenden?
Momentan ist meine Hw, noch nicht angekommen - daher versuch ich mich ein wenig einzulesen damit ich es dann einfacher habe.
Liebe grüße -
oh das Projekt von dir ist mir nicht ins Auge gesprungen, dann werd ich mich da mal dran versuchen - für den pi hätte ich eh noch einen anderen Verwendungszweck
-
richtig das wäre mein plan, da schon ein raspberry vorhanden/er preislich interessant ist. Warum wäre das übertrieben?