From: Vladimir Garistov Date: Sat, 8 Oct 2022 19:28:19 +0000 (+0300) Subject: IMP: Improved the big LED strip demo X-Git-Url: https://kolegite.com/gitweb/?a=commitdiff_plain;h=e809240d7c21ad67305805e645833df3fd9a78e8;p=vmks.git IMP: Improved the big LED strip demo --- diff --git a/Examples/Big_LED_strip/Big_LED_strip.ino b/Examples/Big_LED_strip/Big_LED_strip.ino index 0421bad..d0b2c42 100644 --- a/Examples/Big_LED_strip/Big_LED_strip.ino +++ b/Examples/Big_LED_strip/Big_LED_strip.ino @@ -8,15 +8,7 @@ #define BIG_IMAGE_FILE_SIZE 780 #define DIMM 4 -/* - ATMEGA328P has only 2KiB RAM. The three copies of the color data (const ppm image file, - working buffer and NeoPixel library buffer) alone require slightly more than that. - When loop() is called, the stack collides with the heap and overrides the library buffer. - The resulting visual effect is interesting but in order to actually display the image - we must do so directly without allocating a working buffer. - Ъomment this to indicate that display_rgb_direct() must be used. -*/ -//#define NEOPIXEL_ATE_MY_RAM +#define Y_U_NO_WORK //#define STM32 #ifdef STM32 @@ -31,76 +23,40 @@ int display_rgb_direct(const uint8_t image[]); static const uint8_t big_image_data[BIG_IMAGE_FILE_SIZE] = { - 0x50, 0x36, 0x0a, 0x33, 0x32, 0x20, 0x38, 0x0a, 0x32, 0x35, 0x35, 0x0a, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, - 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, - 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, - 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, - 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, - 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, - 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, - 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, - 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, - 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, - 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, - 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, - 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, - 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, - 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, - 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, - 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, - 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x50, 0x36, 0x0a, 0x33, 0x32, 0x20, 0x38, 0x0a, 0x32, 0x35, 0x35, 0x0a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, + 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, + 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x21, 0x96, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; Adafruit_NeoPixel led_matrix(NUM_PIXELS, LED_PIN, NEO_GRB); void setup() { - pinMode(LED_PIN, OUTPUT); led_matrix.begin(); + led_matrix.fill(led_matrix.Color(0, 20 / DIMM, 6 / DIMM)); } void loop() { - #ifdef NEOPIXEL_ATE_MY_RAM + #ifdef Y_U_NO_WORK + + volatile uint8_t hax[27] = {0}; // Interesting values: 19, 20-31, 32, 50 uint8_t frame_buffer[ROWS][COLS][3] = {{{0}}}; render_image(frame_buffer, big_image_data); display_rgb(frame_buffer); + #else + display_rgb_direct(big_image_data); - #endif + #endif } int render_image(uint8_t buff[ROWS][COLS][3], const uint8_t image[]) @@ -135,20 +91,26 @@ int display_rgb(uint8_t buff[ROWS][COLS][3]) { for (uint8_t row = 0; row < ROWS; row++) { - led_matrix.setPixelColor(col * ROWS + row, - led_matrix.Color(buff[row][col][0] / DIMM, - buff[row][col][1] / DIMM, - buff[row][col][2] / DIMM)); + if (buff[row][col][0] || buff[row][col][1] || buff[row][col][2]) + { + led_matrix.setPixelColor(col * ROWS + row, + led_matrix.Color(buff[row][col][0] / DIMM, + buff[row][col][1] / DIMM, + buff[row][col][2] / DIMM)); + } } } for (uint8_t col = 1; col < COLS; col += 2) { for (uint8_t row = 0; row < ROWS; row++) { - led_matrix.setPixelColor((col + 1) * ROWS - row - 1, - led_matrix.Color(buff[row][col][0] / DIMM, - buff[row][col][1] / DIMM, - buff[row][col][2] / DIMM)); + if (buff[row][col][0] || buff[row][col][1] || buff[row][col][2]) + { + led_matrix.setPixelColor((col + 1) * ROWS - row - 1, + led_matrix.Color(buff[row][col][0] / DIMM, + buff[row][col][1] / DIMM, + buff[row][col][2] / DIMM)); + } } } led_matrix.show(); @@ -158,7 +120,7 @@ int display_rgb(uint8_t buff[ROWS][COLS][3]) int display_rgb_direct(const uint8_t image[]) { - size_t row_offset, col_offset; + size_t row_offset, col_offset, offset; if (image == NULL) return -1; @@ -169,10 +131,14 @@ int display_rgb_direct(const uint8_t image[]) for (uint8_t row = 0; row < ROWS; row++) { row_offset = row * COLS * 3; - led_matrix.setPixelColor(col * ROWS + row, - led_matrix.Color(image[PPM_HEADER_LENGHT + row_offset + col_offset] / DIMM, - image[PPM_HEADER_LENGHT + row_offset + col_offset + 1] / DIMM, - image[PPM_HEADER_LENGHT + row_offset + col_offset + 2] / DIMM)); + offset = PPM_HEADER_LENGHT + row_offset + col_offset; + if (image[offset] || image[offset + 1] || image[offset + 2]) + { + led_matrix.setPixelColor(col * ROWS + row, + led_matrix.Color(image[offset] / DIMM, + image[offset + 1] / DIMM, + image[offset + 2] / DIMM)); + } } } for (uint8_t col = 1; col < COLS; col += 2) @@ -181,10 +147,14 @@ int display_rgb_direct(const uint8_t image[]) for (uint8_t row = 0; row < ROWS; row++) { row_offset = row * COLS * 3; - led_matrix.setPixelColor((col + 1) * ROWS - row - 1, - led_matrix.Color(image[PPM_HEADER_LENGHT + row_offset + col_offset] / DIMM, - image[PPM_HEADER_LENGHT + row_offset + col_offset + 1] / DIMM, - image[PPM_HEADER_LENGHT + row_offset + col_offset + 2] / DIMM)); + offset = PPM_HEADER_LENGHT + row_offset + col_offset; + if (image[offset] || image[offset + 1] || image[offset + 2]) + { + led_matrix.setPixelColor((col + 1) * ROWS - row - 1, + led_matrix.Color(image[offset] / DIMM, + image[offset + 1] / DIMM, + image[offset + 2] / DIMM)); + } } } led_matrix.show();