Die CCU bietet ja folgende Einstellungen an: Crossfade ist ziemlich klar -
Code: Alles auswählen
pwmCold = uint32_t(bright * charLevelLimit * adjust) / 200;
pwmWarm = uint32_t(bright * charLevelLimit * (200 - adjust)) / 200;
Moderator: Co-Administratoren
Code: Alles auswählen
pwmCold = uint32_t(bright * charLevelLimit * adjust) / 200;
pwmWarm = uint32_t(bright * charLevelLimit * (200 - adjust)) / 200;
Code: Alles auswählen
if (charBaseType == 0) { // CHARACTERISTIC_CROSSFADE
pwmCold = uint32_t((bright * charLevelLimit * adjust) / 200);
pwmWarm = uint32_t((bright * charLevelLimit * (200 - adjust)) / 200);
//DPRINT("cf c: "); DPRINT(pwmCold); DPRINT(", w: "); DPRINTLN(pwmWarm);
}
else if (charBaseType == 1) { // CHARACTERISTIC_DIM2WARM
pwmCold = uint32_t((bright * adjust * adjust) / 40000);
uint8_t t_adj = 200 - adjust;
if (charLevelLimit == 1) {
t_adj = (adjust > 100) ? adjust - 100 : 100 - adjust;
t_adj *= 2;
}
pwmWarm = int32_t((-1 * bright * t_adj * t_adj) / 40000) + bright;
//DPRINT("d2w b: "); DPRINT(bright); DPRINT(", c: "); DPRINT(pwmCold); DPRINT(", w: "); DPRINTLN(pwmWarm);
}
else if (charBaseType == 2) { // CHARACTERISTIC_DIM2HOT
uint8_t t_adj = (adjust < 100) ? 0 : adjust - 100;
pwmCold = uint32_t((bright * t_adj) / 100);
t_adj = adjust;
if (charLevelLimit == 1) {
t_adj = (adjust > 100) ? 200 - adjust : adjust;
t_adj /= 2;
}
pwmWarm = uint32_t((bright * t_adj) / 100);
//DPRINT("d2h b: "); DPRINT(bright); DPRINT(", c: "); DPRINT(pwmCold); DPRINT(", w: "); DPRINTLN(pwmWarm);
}
if (pwmCold > 200) pwmCold = 200;
if (pwmWarm > 200) pwmWarm = 200;