mirror of
https://github.com/anklimov/lighthub
synced 2025-12-09 05:09:49 +03:00
HSV -> RGB translation for Adafruit fixed (OMG!)
RGB volume restoring issue fixed AirFlow regulator action timer more precsision
This commit is contained in:
@@ -187,7 +187,7 @@ case S_SET:
|
||||
if (chActive>0 && !st) item->setCmd(CMD_OFF);
|
||||
if (chActive==0 && st) item->setCmd(CMD_ON);
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS | SEND_DEFFERED);
|
||||
item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
}
|
||||
else item->SendStatus(SEND_PARAMETERS | SEND_DEFFERED);
|
||||
|
||||
@@ -211,7 +211,7 @@ case S_CMD:
|
||||
st = item->getVal();
|
||||
|
||||
|
||||
if (st && (st<MIN_VOLUME)) st=INIT_VOLUME;
|
||||
if (st && (st<MIN_VOLUME) && send) st=INIT_VOLUME;
|
||||
item->setVal(st);
|
||||
|
||||
if (st) //Stored smthng
|
||||
@@ -227,12 +227,12 @@ case S_CMD:
|
||||
item->setVal(st);
|
||||
if (send) item->SendStatus(SEND_COMMAND | SEND_PARAMETERS );
|
||||
}
|
||||
item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
return 1;
|
||||
|
||||
case CMD_OFF:
|
||||
if (send) item->SendStatus(SEND_COMMAND);
|
||||
item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
return 1;
|
||||
|
||||
} //switch cmd
|
||||
|
||||
@@ -121,7 +121,7 @@ CRGB pixel;
|
||||
int Value = map(st->v, 0, 100, 0, 255);
|
||||
|
||||
#ifdef ADAFRUIT_LED
|
||||
uint16_t Hue = map(st->h, 0, 365, 0, 655535);
|
||||
uint16_t Hue = map(st->h, 0, 365, 0, 65535);
|
||||
pixel = leds->ColorHSV(Hue, Saturation, Value);
|
||||
#else
|
||||
int Hue = map(st->h, 0, 365, 0, 255);
|
||||
@@ -287,7 +287,7 @@ case S_CMD:
|
||||
PixelCtrl(&st,CMD_ON,from,to);
|
||||
else //whole strip
|
||||
{
|
||||
if (st.aslong && (st.v<MIN_VOLUME)) st.v=INIT_VOLUME;
|
||||
if (st.aslong && (st.v<MIN_VOLUME) && send) st.v=INIT_VOLUME;
|
||||
item->setVal(st.aslong);
|
||||
|
||||
if (st.aslong ) //Stored smthng
|
||||
|
||||
Reference in New Issue
Block a user