Code seems to be working, except transitions after the first don't seem
to fade.
red.value = 0;
grn.value = 0;
blu.value = 0;
wht.value = 0;
red.value = 0;
grn.value = 0;
blu.value = 0;
wht.value = 0;
+ leds_set(red, grn, blu, wht);
+ rgb_on();
leds_set(red, grn, blu, wht);
}
leds_set(red, grn, blu, wht);
}
{
if (on) {
turnOff();
if (btn_rs() == BTN_RS_RIGHT)
{
if (on) {
turnOff();
if (btn_rs() == BTN_RS_RIGHT)
- tmr_start(TMR_AUTO_OFFON, AUTO_OFF_COUNT);
+ tmr_start(TMR_AUTO_OFFON, AUTO_ON_COUNT);
} else /* off */ {
turnOn();
if (btn_rs() == BTN_RS_RIGHT)
} else /* off */ {
turnOn();
if (btn_rs() == BTN_RS_RIGHT)
- tmr_start(TMR_AUTO_OFFON, AUTO_ON_COUNT);
+ tmr_start(TMR_AUTO_OFFON, AUTO_OFF_COUNT);
start_fade();
break;
case TASK_AUTO_OFFON: /* auto on/off timer has fired */
start_fade();
break;
case TASK_AUTO_OFFON: /* auto on/off timer has fired */