diff --git a/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h b/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h index 899932c..a48b268 100644 --- a/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h +++ b/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h @@ -91,6 +91,7 @@ public: bool setBrightness(int brightness); private: + // matrix objects TaskHandle_t displayUpdateTask; NeoPixelBrightnessBusGfx *matrix; diff --git a/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp b/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp index ec13925..dfea509 100644 --- a/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp +++ b/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp @@ -2,7 +2,8 @@ LedDisplayController *ledDisplayControllerGlobal = nullptr; - +static const uint8_t StepsFade = 255; +static const float RFade = (StepsFade*log10(2))/log10(255); // -------------------- // - Public functions - @@ -188,7 +189,7 @@ void LedDisplayController::disp_scroll_text() void LedDisplayController::show_matrix(const char *text, int pos, const char *color) { //Serial.printf("TEXT: %s (pos=%d, color=%d)\n", text, pos, this->colorFromHex(String(color))); - this->matrix->SetBrightness(this->text_sets.disp_brightness); + this->matrix->SetBrightness(pow (2, (this->text_sets.disp_brightness / RFade)) - 1); this->matrix->setTextColor(this->colorFromHex(String(color))); this->matrix->setCursor(pos, 0); this->matrix->print(text);