Merge remote-tracking branch 'origin/master'

# Conflicts:
#	vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp
This commit is contained in:
Dorian Zedler 2020-10-18 16:27:33 +02:00
commit 2db886df34
Signed by: dorian
GPG Key ID: D3B255CB8BC7CD37
2 changed files with 5 additions and 1 deletions

View File

@ -94,6 +94,7 @@ public:
void setAutomaticBrightnessAdjustment(bool automaticBrightnessAdjustment);
private:
// matrix objects
TaskHandle_t displayUpdateTask;
NeoPixelBrightnessBusGfx<NeoGrbFeature, Neo800KbpsMethod> *matrix;

View File

@ -2,6 +2,9 @@
LedDisplayController *ledDisplayControllerGlobal = nullptr;
static const uint8_t StepsFade = 255;
static const float RFade = (StepsFade*log10(2))/log10(255);
// --------------------
// - Public functions -
// --------------------
@ -188,7 +191,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);