Skip to content

Commit

Permalink
feat: add screen test code on init
Browse files Browse the repository at this point in the history
  • Loading branch information
schw4rzlicht committed Nov 13, 2023
1 parent 5ad09fa commit d96d189
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,28 @@ void setup()

Screen.setup();
Screen.clear();

// screen test

int currentBrightness = Screen.getCurrentBrightness();
Screen.setBrightness(255);

for (int i = 0; i < ROWS * COLS; i++) {
// need to call this with 1, see https://github.com/ph1p/ikea-led-obegraensad/issues/52
Screen.setPixelAtIndex(i, 255, 1);

delay(10);
}

for (int i = 0; i < ROWS * COLS; i++) {
Screen.setPixelAtIndex(i, 0);
delay(10);
}

Screen.setBrightness(currentBrightness);

// end screen test

loadMode();
Screen.loadFromStorage();
}
Expand Down

0 comments on commit d96d189

Please sign in to comment.