diff options
| author | mrcodetastic <12006953+mrcodetastic@users.noreply.github.com> | 2024-09-19 22:24:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-19 22:24:16 +0100 |
| commit | bba1a47f01d079323f60982b0215810715d5095d (patch) | |
| tree | f61698a7ac83c2bf642d20679b7b1a63ccae8097 /examples/1_SimpleTestShapes | |
| parent | 7929b978505bfa29d89292b6c38f9a2dfffd105a (diff) | |
| parent | 268fd5ea4e22631cabe280217623d642dff52d7c (diff) | |
Merge pull request #676 from DevxMike/master
fixed nullptr dereference
Diffstat (limited to 'examples/1_SimpleTestShapes')
| -rw-r--r-- | examples/1_SimpleTestShapes/1_SimpleTestShapes.ino | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/examples/1_SimpleTestShapes/1_SimpleTestShapes.ino b/examples/1_SimpleTestShapes/1_SimpleTestShapes.ino index 1d2ca75..64fb76c 100644 --- a/examples/1_SimpleTestShapes/1_SimpleTestShapes.ino +++ b/examples/1_SimpleTestShapes/1_SimpleTestShapes.ino @@ -13,13 +13,7 @@ //MatrixPanel_I2S_DMA dma_display; MatrixPanel_I2S_DMA *dma_display = nullptr; -uint16_t myBLACK = dma_display->color565(0, 0, 0); -uint16_t myWHITE = dma_display->color565(255, 255, 255); -uint16_t myRED = dma_display->color565(255, 0, 0); -uint16_t myGREEN = dma_display->color565(0, 255, 0); -uint16_t myBLUE = dma_display->color565(0, 0, 255); - - +uint16_t myBLACK, myWHITE, myRED, myGREEN, myBLUE; // Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. @@ -109,6 +103,14 @@ void setup() { dma_display->begin(); dma_display->setBrightness8(90); //0-255 dma_display->clearScreen(); + + myBLACK = dma_display->color565(0, 0, 0); + myWHITE = dma_display->color565(255, 255, 255); + myRED = dma_display->color565(255, 0, 0); + myGREEN = dma_display->color565(0, 255, 0); + myBLUE = dma_display->color565(0, 0, 255); + + dma_display->fillScreen(myWHITE); // fix the screen with green |
