Skip to content

Commit

Permalink
Adjust matrix brightness, timing
Browse files Browse the repository at this point in the history
  • Loading branch information
oseiler2 committed Jan 31, 2023
1 parent 7e14bc6 commit c720530
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/neopixelMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ uint16_t NeopixelMatrix::ppmToColour(uint16_t ppm) {
}

void NeopixelMatrix::showText() {
matrix->setBrightness(config.brightness);
matrix->fillScreen(0);
matrix->setTextColor(matrix->Color(255, 255, 255));//ppmToColour(currentPpm));
matrix->setCursor(scrollPosition + (scrollWidth > 0 ? 1 : 0), MATRIX_HEIGHT);
Expand All @@ -112,6 +113,9 @@ void NeopixelMatrix::show(uint16_t ppm, bool showDrip) {
// uint32_t start = micros();
uint8_t dots = ppmToDots(ppm);

float eps = 1 - ((float)dots / NUMBER_OF_DOTS);
matrix->setBrightness(min(int(config.brightness + (eps * 10)), 255));

matrix->clear();
matrix->fillScreen(0);
// matrix->fillScreen(matrix->Color(255, 0, 255));
Expand Down Expand Up @@ -311,7 +315,7 @@ void NeopixelMatrix::neopixelMatrixLoop(void* pvParameters) {
instance->update(instance->currentPpm);
}
}
notified = xQueueReceive(instance->updateQueue, &msg, pdMS_TO_TICKS(10));
notified = xQueueReceive(instance->updateQueue, &msg, pdMS_TO_TICKS(100));
if (notified == pdPASS) {
if (msg.cmd == X_CMD_SHOW_PPM) {
instance->show(msg.ppm, false);
Expand Down

0 comments on commit c720530

Please sign in to comment.