/// Must be called at least every ms void run() { led->run(); if (timer.isExpired() && (isBlinking || state == FIRST_BREAK || state == SECOND_BREAK)) { switch (state) { case FIRST_FLASH: led->on(onFade); timer.restart(on1); state = FIRST_BREAK; break; case FIRST_BREAK: led->off(offFade); timer.restart(pause1); state = SECOND_FLASH; break; case SECOND_FLASH: led->on(onFade); if (isCounting && !--counter) { isBlinking = false; isCounting = false; } timer.restart(on2); state = SECOND_BREAK; break; case SECOND_BREAK: led->off(offFade); timer.restart(pause2); default: state = FIRST_FLASH; break; } } }
void setGroupColor(xpcc::rpr::Transmitter& /*node*/, xpcc::rpr::Message *message) { colorBuffer.color.red = *(message->payload + volatileGroupPixel*3); colorBuffer.color.green = *(message->payload + volatileGroupPixel*3 + 1); colorBuffer.color.blue = *(message->payload + volatileGroupPixel*3 + 2); #if IS_DREAM_GENERATOR receiverTimeout.restart(15000); #endif }