diff --git a/colorchord2/DisplayNetwork.c b/colorchord2/DisplayNetwork.c index 03ddcef..67d21bc 100644 --- a/colorchord2/DisplayNetwork.c +++ b/colorchord2/DisplayNetwork.c @@ -30,6 +30,8 @@ struct DPODriver { int leds; int skipfirst; + int wled_realtime; + int wled_timeout; int fliprg; int flipgb; int firstval; @@ -100,6 +102,17 @@ static void DPOUpdate(void * id, struct NoteFinder*nf) d->firstval = 0; i = 0; + + if(d->wled_realtime) + { + //Packet byte 0 is 2 (DRGB mode) or 3 (DRGBW mode) if is_rgby + buffer[i] = 2 + d->is_rgby; + lbuff[i++] = 2 + d->is_rgby; + //Packet byte 1 is the time in seconds the controller will wait to take control after it stops receiving data + buffer[i] = d->wled_timeout; + lbuff[i++] = d->wled_timeout; + } + while( i < d->skipfirst ) { lbuff[i] = d->firstval; @@ -216,11 +229,13 @@ static void DPOParams(void * id ) d->leds = 10; RegisterValue( "leds", PAINT, &d->leds, sizeof( d->leds ) ); d->skipfirst = 1; RegisterValue( "skipfirst", PAINT, &d->skipfirst, sizeof( d->skipfirst ) ); + d->wled_realtime = 0;RegisterValue( "wled_realtime", PAINT, &d->wled_realtime, sizeof( d->wled_realtime ) ); + d->wled_timeout = 2;RegisterValue( "wled_timeout", PAINT, &d->wled_timeout, sizeof( d->wled_timeout ) ); d->port = 7777; RegisterValue( "port", PAINT, &d->port, sizeof( d->port ) ); d->firstval = 0; RegisterValue( "firstval", PAINT, &d->firstval, sizeof( d->firstval ) ); RegisterValue( "address", PABUFFER, d->address, sizeof( d->address ) ); d->fliprg = 0; RegisterValue( "fliprg", PAINT, &d->fliprg, sizeof( d->fliprg ) ); - d->flipgb = 0; RegisterValue( "flipgb", PAINT, &d->flipgb, sizeof( d->flipgb ) ); + d->flipgb = 0; RegisterValue( "flipgb", PAINT, &d->flipgb, sizeof( d->flipgb ) ); d->is_rgby = 0; RegisterValue( "rgby", PAINT, &d->is_rgby, sizeof( d->is_rgby ) ); d->skittlequantity=0;RegisterValue( "skittlequantity", PAINT, &d->skittlequantity, sizeof( d->skittlequantity ) ); d->socket = -1; diff --git a/colorchord2/wled.conf b/colorchord2/wled.conf new file mode 100644 index 0000000..b7a5d81 --- /dev/null +++ b/colorchord2/wled.conf @@ -0,0 +1,23 @@ +# Normal Colorchord stuff +outdrivers = DisplayNetwork, OutputLinear +headless = 1 +leds = 30 +light_siding = 1.5 #Turn this to ~1.9 for more uniformity, ~1.0 for less. +cpu_autolimit_interval=.014 +cpu_autolimit = 1 +satamp = 1.600 +is_loop=0 +led_floor = .18 +steady_bright = 0 +devplay = default +fliprg=0 +slope=.5 +amplify=1 +base_hz = 51.5000 + +#WLED Integration stuff +wled_realtime=1 #Enable WLED Interfacing params +port = 19446 #Default port for UDP Realtime +address = 192.168.0.24 #WLED Node IP +wled_timeout=2 +