WLED Integration and example config

This commit is contained in:
wesleygas 2021-04-04 23:49:59 -03:00
parent b28c4d2c40
commit 2fbc910415
2 changed files with 39 additions and 1 deletions

View file

@ -30,6 +30,8 @@ struct DPODriver
{ {
int leds; int leds;
int skipfirst; int skipfirst;
int wled_realtime;
int wled_timeout;
int fliprg; int fliprg;
int flipgb; int flipgb;
int firstval; int firstval;
@ -100,6 +102,17 @@ static void DPOUpdate(void * id, struct NoteFinder*nf)
d->firstval = 0; d->firstval = 0;
i = 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 ) while( i < d->skipfirst )
{ {
lbuff[i] = d->firstval; 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->leds = 10; RegisterValue( "leds", PAINT, &d->leds, sizeof( d->leds ) );
d->skipfirst = 1; RegisterValue( "skipfirst", PAINT, &d->skipfirst, sizeof( d->skipfirst ) ); 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->port = 7777; RegisterValue( "port", PAINT, &d->port, sizeof( d->port ) );
d->firstval = 0; RegisterValue( "firstval", PAINT, &d->firstval, sizeof( d->firstval ) ); d->firstval = 0; RegisterValue( "firstval", PAINT, &d->firstval, sizeof( d->firstval ) );
RegisterValue( "address", PABUFFER, d->address, sizeof( d->address ) ); RegisterValue( "address", PABUFFER, d->address, sizeof( d->address ) );
d->fliprg = 0; RegisterValue( "fliprg", PAINT, &d->fliprg, sizeof( d->fliprg ) ); 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->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->skittlequantity=0;RegisterValue( "skittlequantity", PAINT, &d->skittlequantity, sizeof( d->skittlequantity ) );
d->socket = -1; d->socket = -1;

23
colorchord2/wled.conf Normal file
View file

@ -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