├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .gitmodules ├── COPYING ├── FastLED_NeoMatrix.cpp ├── FastLED_NeoMatrix.h ├── README.md ├── examples ├── FastLED ├── GFX ├── LEDMatrix ├── MatrixGFXDemo │ ├── MatrixGFXDemo.ino │ ├── README.md │ ├── bluesmiley24.h │ ├── google32.h │ ├── heart24.h │ ├── linux32.h │ ├── smileytongue24.h │ └── yellowsmiley24.h ├── MatrixGFXDemo64 │ ├── MatrixGFXDemo64.ino │ ├── bluesmiley24.h │ ├── google32.h │ ├── heart24.h │ ├── linux32.h │ ├── smileytongue24.h │ └── yellowsmiley24.h ├── NeoMatrix_LEDMatrix │ ├── LEDMatrix_Flag.ino │ ├── NeoMatrix_LEDMatrix.ino │ ├── README │ └── config.h ├── README.md ├── espgifread │ ├── GifPlayer.h │ ├── README.md │ ├── config.h │ ├── data │ │ └── gifs │ │ │ ├── 32anim_balls.gif │ │ │ ├── 32anim_dance.gif │ │ │ ├── 32anim_flower.gif │ │ │ └── 32anim_photon.gif │ └── espgifread.ino ├── fontzoom │ ├── README.md │ ├── fonts.h │ └── fontzoom.ino ├── matrixtest │ └── matrixtest.pde └── tiletest │ └── tiletest.pde └── library.properties /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for opening an issue on an Adafruit Arduino library repository. To 2 | improve the speed of resolution please review the following guidelines and 3 | common troubleshooting steps below before creating the issue: 4 | 5 | - **Do not use GitHub issues for troubleshooting projects and issues.** Instead use 6 | the forums at http://forums.adafruit.com to ask questions and troubleshoot why 7 | something isn't working as expected. In many cases the problem is a common issue 8 | that you will more quickly receive help from the forum community. GitHub issues 9 | are meant for known defects in the code. If you don't know if there is a defect 10 | in the code then start with troubleshooting on the forum first. 11 | 12 | - **If following a tutorial or guide be sure you didn't miss a step.** Carefully 13 | check all of the steps and commands to run have been followed. Consult the 14 | forum if you're unsure or have questions about steps in a guide/tutorial. 15 | 16 | - **For Arduino projects check these very common issues to ensure they don't apply**: 17 | 18 | - For uploading sketches or communicating with the board make sure you're using 19 | a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes 20 | very hard to tell the difference between a data and charge cable! Try using the 21 | cable with other devices or swapping to another cable to confirm it is not 22 | the problem. 23 | 24 | - **Be sure you are supplying adequate power to the board.** Check the specs of 25 | your board and plug in an external power supply. In many cases just 26 | plugging a board into your computer is not enough to power it and other 27 | peripherals. 28 | 29 | - **Double check all soldering joints and connections.** Flakey connections 30 | cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. 31 | 32 | - **Ensure you are using an official Arduino or Adafruit board.** We can't 33 | guarantee a clone board will have the same functionality and work as expected 34 | with this code and don't support them. 35 | 36 | If you're sure this issue is a defect in the code and checked the steps above 37 | please fill in the following fields to provide enough troubleshooting information. 38 | You may delete the guideline and text above to just leave the following details: 39 | 40 | - Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** 41 | 42 | - Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO 43 | VERSION HERE** 44 | 45 | - List the steps to reproduce the problem below (if possible attach a sketch or 46 | copy the sketch code in too): **LIST REPRO STEPS BELOW** 47 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for creating a pull request to contribute to Adafruit's GitHub code! 2 | Before you open the request please review the following guidelines and tips to 3 | help it be more easily integrated: 4 | 5 | - **Describe the scope of your change--i.e. what the change does and what parts 6 | of the code were modified.** This will help us understand any risks of integrating 7 | the code. 8 | 9 | - **Describe any known limitations with your change.** For example if the change 10 | doesn't apply to a supported platform of the library please mention it. 11 | 12 | - **Please run any tests or examples that can exercise your modified code.** We 13 | strive to not break users of the code and running tests/examples helps with this 14 | process. 15 | 16 | Thank you again for contributing! We will try to test and integrate the change 17 | as soon as we can, but be aware we have many GitHub repositories to manage and 18 | can't immediately respond to every request. There is no need to bump or check in 19 | on a pull request (it will clutter the discussion of the request). 20 | 21 | Also don't be worried if the request is closed or not integrated--sometimes the 22 | priorities of Adafruit's GitHub code (education, ease of use) might not match the 23 | priorities of the pull request. Don't fret, the open source community thrives on 24 | forks and GitHub makes it easy to keep your changes in a forked repo. 25 | 26 | After reviewing the guidelines above you can delete this text from the pull request. 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # vim 2 | *.swp 3 | 4 | # Prerequisites 5 | *.d 6 | 7 | # Compiled Object files 8 | *.slo 9 | *.lo 10 | *.o 11 | *.obj 12 | 13 | # Precompiled Headers 14 | *.gch 15 | *.pch 16 | 17 | # Compiled Dynamic libraries 18 | *.so 19 | *.dylib 20 | *.dll 21 | 22 | # Fortran module files 23 | *.mod 24 | *.smod 25 | 26 | # Compiled Static libraries 27 | *.lai 28 | *.la 29 | *.a 30 | *.lib 31 | 32 | # Executables 33 | *.exe 34 | *.out 35 | *.app 36 | 37 | 38 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "examples/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos"] 2 | path = examples/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos 3 | url = https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos 4 | -------------------------------------------------------------------------------- /FastLED_NeoMatrix.cpp: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | Arduino library based on Adafruit_Neomatrix but modified to work with FastLED 3 | by Marc MERLIN 4 | 5 | Original notice and license from Adafruit_Neomatrix: 6 | ------------------------------------------------------------------------ 7 | Arduino library to control single and tiled matrices of WS2811- and 8 | WS2812-based RGB LED devices such as the Adafruit NeoPixel Shield or 9 | displays assembled from NeoPixel strips, making them compatible with 10 | the Adafruit_GFX graphics library. Requires both the FastLED_NeoPixel 11 | and Adafruit_GFX libraries. 12 | 13 | Written by Phil Burgess / Paint Your Dragon for Adafruit Industries. 14 | 15 | Adafruit invests time and resources providing this open source code, 16 | please support Adafruit and open-source hardware by purchasing products 17 | from Adafruit! 18 | 19 | ------------------------------------------------------------------------- 20 | This file is part of the Adafruit NeoMatrix library. 21 | 22 | NeoMatrix is free software: you can redistribute it and/or modify 23 | it under the terms of the GNU Lesser General Public License as 24 | published by the Free Software Foundation, either version 3 of 25 | the License, or (at your option) any later version. 26 | 27 | NeoMatrix is distributed in the hope that it will be useful, 28 | but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | GNU Lesser General Public License for more details. 31 | 32 | You should have received a copy of the GNU Lesser General Public 33 | License along with NeoMatrix. If not, see 34 | . 35 | -------------------------------------------------------------------------*/ 36 | 37 | #include 38 | #include 39 | 40 | // Constructor for single matrix: 41 | FastLED_NeoMatrix::FastLED_NeoMatrix(CRGB *leds, uint16_t w, uint16_t h, uint8_t matrixType): 42 | Framebuffer_GFX(leds, w, h, NULL) { 43 | type = matrixType; 44 | tilesX = 0; 45 | tilesY = 0; 46 | } 47 | 48 | // Constructor for tiled matrices: 49 | FastLED_NeoMatrix::FastLED_NeoMatrix(CRGB *leds, uint16_t mW, uint16_t mH, 50 | uint8_t tX, uint8_t tY, uint8_t matrixType) : 51 | Framebuffer_GFX(leds, mW * tX, mH * tY, NULL) { 52 | matrixWidth = mW; 53 | matrixHeight = mH; 54 | type = matrixType; 55 | tilesX = tX; 56 | tilesY = tY; 57 | } 58 | 59 | void FastLED_NeoMatrix::show() { 60 | Framebuffer_GFX::showfps(); 61 | if (_show) { _show(); return; }; 62 | #ifdef ESP8266 63 | // Disable watchdog interrupt so that it does not trigger in the middle of 64 | // updates. and break timing of pixels, causing random corruption on interval 65 | // https://github.com/esp8266/Arduino/issues/34 66 | ESP.wdtDisable(); 67 | #endif 68 | FastLED.show(); 69 | #ifdef ESP8266 70 | ESP.wdtEnable(1000); 71 | #endif 72 | } 73 | 74 | 75 | // vim:sts=2:sw=2 76 | -------------------------------------------------------------------------------- /FastLED_NeoMatrix.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------- 2 | Arduino library based on Adafruit_Neomatrix but modified to work with FastLED 3 | by Marc MERLIN 4 | 5 | Original notice and license from Adafruit_Neomatrix: 6 | NeoMatrix is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Lesser General Public License as 8 | published by the Free Software Foundation, either version 3 of 9 | the License, or (at your option) any later version. 10 | 11 | NeoMatrix is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with NeoMatrix. If not, see 18 | . 19 | --------------------------------------------------------------------*/ 20 | 21 | #ifndef _FASTLED_NEOMATRIX_H_ 22 | #define _FASTLED_NEOMATRIX_H_ 23 | #include "Framebuffer_GFX.h" 24 | 25 | #if defined(ESP8266) 26 | // If you get matrix flickering, modify platforms/esp/8266/clockless_esp8266.h 27 | // and platforms/esp/8266/clockless_block_esp8266.h to change WAIT_TIME to 20 28 | //#pragma message "If you get matrix corruption, turn off FASTLED_ALLOW_INTERRUPTS" 29 | //#pragma message "in this library, or modify WAIT_TIME in platforms/esp/8266/clockless_esp8266.h" 30 | //#pragma message "(raise it from 5 to 20 or up to 50 if needed)" 31 | // Or if you don't need interrupts, you can disable them here 32 | //#define FASTLED_ALLOW_INTERRUPTS 0 33 | #endif 34 | #include 35 | 36 | /* 37 | * Ideally FastLED_NeoMatrix would multiple inherit from CFastLED too 38 | * I tried this, but on that path laid madness, apparent compiler bugs 39 | * and pain due to the unfortunate use of templates in FastLED, preventing 40 | * passing initalization arguments in the object since they need to be 41 | * hardcoded at compile time as template values :( -- merlin 42 | * See https://github.com/marcmerlin/FastLED_NeoMatrix/blob/cd739d471bbbe22336f281f1d1988aa7e7572340/FastLED_NeoMatrix.cpp#L92 43 | */ 44 | class FastLED_NeoMatrix : public Framebuffer_GFX { 45 | 46 | public: 47 | // Constructor for single matrix: 48 | FastLED_NeoMatrix(CRGB *, uint16_t w, uint16_t h, 49 | uint8_t matrixType = NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS); 50 | 51 | // Constructor for tiled matrices: 52 | FastLED_NeoMatrix(CRGB *, uint16_t matrixW, uint16_t matrixH, 53 | uint8_t tX, uint8_t tY, 54 | uint8_t matrixType = NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + 55 | NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_ROWS); 56 | 57 | void show(); 58 | void setBrightness(int b) { FastLED.setBrightness(b); }; 59 | }; 60 | 61 | #endif // _FASTLED_NEOMATRIX_H_ 62 | // vim:sts=2:sw=2 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | FastLED NeoMatrix: Matrix with FastLED using Adafruit::GFX API 2 | ============================================================== 3 | 4 | Blog post with details and pictures: 5 | http://marc.merlins.org/perso/arduino/post_2018-04-23_FastLED_NeoMatrix-library_-how-to-do-Matrices-with-FastLED-and-Adafruit_GFX.html 6 | 7 | Adafruit_GFX and FastLED-compatible library for NeoPixel matrices and grids. Controls single and tiled NeoPixel displays. 8 | This library requires FastLED and Adafruit_GFX libraries as well as this base class library: 9 | - https://github.com/marcmerlin/Framebuffer_GFX 10 | Please look at the Framebuffer_GFX page for details on how the APIs work and you can also look the example demo code: 11 | - https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/examples/MatrixGFXDemo/MatrixGFXDemo.ino 12 | 13 | ### Adafruit::NeoMatrix vs FastLED::NeoMatrix 14 | 15 | This code was taken from Adafruit_NeoMatrix and adapted to work with the more powerful FastLED library. 16 | The reasons for using FastLED instead of Adafruit::Neopixel as a backend, include: 17 | * FastLED supports more microcontrollers 18 | * Better support for ESP32 than Adafruit::Neopixel 19 | * Support for parallel output on some chips for faster refresh rate: https://github.com/FastLED/FastLED/wiki/Parallel-Output 20 | * Support for interrupts to allow things like Infrared to work while updating strips 21 | * Support for many more led/pixel hardware: https://github.com/FastLED/FastLED/wiki/Chipset-reference 22 | * Once you write code for this library, you can trivially adapt it on any other display hardware supported by https://github.com/marcmerlin/Framebuffer_GFX (like RGBPanels, TFTs, etc...). 23 | 24 | How to use the API? It's very close to Adafruit_NeoMatrix, to see an example, you can compare 25 | https://github.com/adafruit/Adafruit_NeoMatrix/blob/master/examples/MatrixGFXDemo/MatrixGFXDemo.ino 26 | with 27 | https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/examples/MatrixGFXDemo/MatrixGFXDemo.ino 28 | 29 | You can find a lot of demo code here: 30 | https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos as well as 31 | a big integrated demo here: https://github.com/marcmerlin/NeoMatrix-FastLED-IR 32 | Most my demos rely on this big file that lets you configure your panel(s) type and size and have it work with all the demo code. It allows using the exact same code on neopixel arrays, rgbpanels, tft screens, and even your linux computer. 33 | 34 | This FastLED_NeoMatrix requires: 35 | - https://github.com/marcmerlin/Framebuffer_GFX (base class) 36 | - https://github.com/adafruit/Adafruit-GFX-Library 37 | - https://github.com/FastLED/FastLED 38 | - https://github.com/marcmerlin/LEDMatrix is optional if you have code that uses that API 39 | 40 | 41 | ### Tiled Matrixes, Zig-Zag and so forth 42 | 43 | See Adafruit's NeoMatrix description, which this lib is fully compatible, with: https://learn.adafruit.com/adafruit-neopixel-uberguide/neomatrix-library 44 | ![image](https://user-images.githubusercontent.com/1369412/74280192-202e4300-4cd1-11ea-945c-a06dbdcecb96.png) 45 | 46 | ### Custom Mappings (non rectangular array) 47 | 48 | If you have a custom made design where the pixels are not in a rectangular pattern, you need to provide a myRemapFn which is then fed to the matrix with "matrix->setRemapFunction(myRemapFn)" 49 | See https://github.com/marcmerlin/FastLED_NeoMatrix/issues/6 for an example. 50 | 51 | ### Demos 52 | 53 | Video demo: https://www.youtube.com/watch?v=tU_wkrrv_4A 54 | 55 | ![164_20170424_adafruit_gfx_on_neomatrix_32x32](https://user-images.githubusercontent.com/1369412/38774532-5d6b0f2e-4020-11e8-86ef-afdffbeb1e1d.jpg) 56 | ![171_20170424_adafruit_gfx_on_neomatrix_32x32](https://user-images.githubusercontent.com/1369412/38774533-5d83d6bc-4020-11e8-95bb-417368143d70.jpg) 57 | -------------------------------------------------------------------------------- /examples/FastLED: -------------------------------------------------------------------------------- 1 | cd FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/FastLED/ 2 | -------------------------------------------------------------------------------- /examples/GFX: -------------------------------------------------------------------------------- 1 | cd FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/GFX/ 2 | -------------------------------------------------------------------------------- /examples/LEDMatrix: -------------------------------------------------------------------------------- 1 | cd FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/LEDMatrix/ 2 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo/MatrixGFXDemo.ino: -------------------------------------------------------------------------------- 1 | // FastLED_NeoMatrix example for single NeoPixel Shield. 2 | // By Marc MERLIN 3 | // Contains code (c) Adafruit, license BSD 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | // Choose your prefered pixmap 10 | //#include "heart24.h" 11 | //#include "yellowsmiley24.h" 12 | //#include "bluesmiley24.h" 13 | #include "smileytongue24.h" 14 | #ifndef PSTR 15 | #define PSTR // Make Arduino Due happy 16 | #endif 17 | 18 | // Allow temporaly dithering, does not work with ESP32 right now 19 | #ifndef ESP32 20 | #define delay FastLED.delay 21 | #endif 22 | 23 | #if defined(ESP32) or defined(ESP8266) 24 | #define PIN 12 // GPIO5 = D1 25 | #else 26 | #define PIN 13 27 | #endif 28 | 29 | 30 | #define P16BY16X4 31 | //#define P32BY8X3 32 | #if defined(P16BY16X4) || defined(P32BY8X3) 33 | #define BM32 34 | #endif 35 | 36 | #ifdef BM32 37 | #include "google32.h" 38 | // Anything with black does not look so good with the naked eye (better on pictures) 39 | //#include "linux32.h" 40 | #endif 41 | 42 | // Max is 255, 32 is a conservative value to not overload 43 | // a USB power supply (500mA) for 12x12 pixels. 44 | #define BRIGHTNESS 16 45 | 46 | // https://learn.adafruit.com/adafruit-neopixel-uberguide/neomatrix-library 47 | // MATRIX DECLARATION: 48 | // Parameter 1 = width of EACH NEOPIXEL MATRIX (not total display) 49 | // Parameter 2 = height of each matrix 50 | // Parameter 3 = number of matrices arranged horizontally 51 | // Parameter 4 = number of matrices arranged vertically 52 | // Parameter 5 = pin number (most are valid) 53 | // Parameter 6 = matrix layout flags, add together as needed: 54 | // NEO_MATRIX_TOP, NEO_MATRIX_BOTTOM, NEO_MATRIX_LEFT, NEO_MATRIX_RIGHT: 55 | // Position of the FIRST LED in the FIRST MATRIX; pick two, e.g. 56 | // NEO_MATRIX_TOP + NEO_MATRIX_LEFT for the top-left corner. 57 | // NEO_MATRIX_ROWS, NEO_MATRIX_COLUMNS: LEDs WITHIN EACH MATRIX are 58 | // arranged in horizontal rows or in vertical columns, respectively; 59 | // pick one or the other. 60 | // NEO_MATRIX_PROGRESSIVE, NEO_MATRIX_ZIGZAG: all rows/columns WITHIN 61 | // EACH MATRIX proceed in the same order, or alternate lines reverse 62 | // direction; pick one. 63 | // NEO_TILE_TOP, NEO_TILE_BOTTOM, NEO_TILE_LEFT, NEO_TILE_RIGHT: 64 | // Position of the FIRST MATRIX (tile) in the OVERALL DISPLAY; pick 65 | // two, e.g. NEO_TILE_TOP + NEO_TILE_LEFT for the top-left corner. 66 | // NEO_TILE_ROWS, NEO_TILE_COLUMNS: the matrices in the OVERALL DISPLAY 67 | // are arranged in horizontal rows or in vertical columns, respectively; 68 | // pick one or the other. 69 | // NEO_TILE_PROGRESSIVE, NEO_TILE_ZIGZAG: the ROWS/COLUMS OF MATRICES 70 | // (tiles) in the OVERALL DISPLAY proceed in the same order for every 71 | // line, or alternate lines reverse direction; pick one. When using 72 | // zig-zag order, the orientation of the matrices in alternate rows 73 | // will be rotated 180 degrees (this is normal -- simplifies wiring). 74 | // See example below for these values in action. 75 | 76 | #if defined(P16BY16X4) 77 | #define mw 32 78 | #define mh 32 79 | #define NUMMATRIX (mw*mh) 80 | CRGB leds[NUMMATRIX]; 81 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, 16, 16, 2, 2, 82 | NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT + 83 | NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG + 84 | NEO_TILE_TOP + NEO_TILE_RIGHT + NEO_TILE_PROGRESSIVE); 85 | 86 | #elif defined(P32BY8X3) 87 | #define mw 24 88 | #define mh 32 89 | #define NUMMATRIX (mw*mh) 90 | CRGB leds[NUMMATRIX]; 91 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, 8, 32, 3, 1, 92 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 93 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG + 94 | NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_PROGRESSIVE); 95 | 96 | #else 97 | #define mw 16 98 | #define mh 16 99 | #define NUMMATRIX (mw*mh) 100 | CRGB leds[NUMMATRIX]; 101 | // Define matrix width and height. 102 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, mw, mh, 103 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 104 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG); 105 | #endif 106 | 107 | 108 | 109 | // This could also be defined as matrix->color(255,0,0) but those defines 110 | // are meant to work for adafruit_gfx backends that are lacking color() 111 | #define LED_BLACK 0 112 | 113 | #define LED_RED_VERYLOW (3 << 11) 114 | #define LED_RED_LOW (7 << 11) 115 | #define LED_RED_MEDIUM (15 << 11) 116 | #define LED_RED_HIGH (31 << 11) 117 | 118 | #define LED_GREEN_VERYLOW (1 << 5) 119 | #define LED_GREEN_LOW (15 << 5) 120 | #define LED_GREEN_MEDIUM (31 << 5) 121 | #define LED_GREEN_HIGH (63 << 5) 122 | 123 | #define LED_BLUE_VERYLOW 3 124 | #define LED_BLUE_LOW 7 125 | #define LED_BLUE_MEDIUM 15 126 | #define LED_BLUE_HIGH 31 127 | 128 | #define LED_ORANGE_VERYLOW (LED_RED_VERYLOW + LED_GREEN_VERYLOW) 129 | #define LED_ORANGE_LOW (LED_RED_LOW + LED_GREEN_LOW) 130 | #define LED_ORANGE_MEDIUM (LED_RED_MEDIUM + LED_GREEN_MEDIUM) 131 | #define LED_ORANGE_HIGH (LED_RED_HIGH + LED_GREEN_HIGH) 132 | 133 | #define LED_PURPLE_VERYLOW (LED_RED_VERYLOW + LED_BLUE_VERYLOW) 134 | #define LED_PURPLE_LOW (LED_RED_LOW + LED_BLUE_LOW) 135 | #define LED_PURPLE_MEDIUM (LED_RED_MEDIUM + LED_BLUE_MEDIUM) 136 | #define LED_PURPLE_HIGH (LED_RED_HIGH + LED_BLUE_HIGH) 137 | 138 | #define LED_CYAN_VERYLOW (LED_GREEN_VERYLOW + LED_BLUE_VERYLOW) 139 | #define LED_CYAN_LOW (LED_GREEN_LOW + LED_BLUE_LOW) 140 | #define LED_CYAN_MEDIUM (LED_GREEN_MEDIUM + LED_BLUE_MEDIUM) 141 | #define LED_CYAN_HIGH (LED_GREEN_HIGH + LED_BLUE_HIGH) 142 | 143 | #define LED_WHITE_VERYLOW (LED_RED_VERYLOW + LED_GREEN_VERYLOW + LED_BLUE_VERYLOW) 144 | #define LED_WHITE_LOW (LED_RED_LOW + LED_GREEN_LOW + LED_BLUE_LOW) 145 | #define LED_WHITE_MEDIUM (LED_RED_MEDIUM + LED_GREEN_MEDIUM + LED_BLUE_MEDIUM) 146 | #define LED_WHITE_HIGH (LED_RED_HIGH + LED_GREEN_HIGH + LED_BLUE_HIGH) 147 | 148 | static const uint8_t PROGMEM 149 | mono_bmp[][8] = 150 | { 151 | { // 0: checkered 1 152 | B10101010, 153 | B01010101, 154 | B10101010, 155 | B01010101, 156 | B10101010, 157 | B01010101, 158 | B10101010, 159 | B01010101, 160 | }, 161 | 162 | { // 1: checkered 2 163 | B01010101, 164 | B10101010, 165 | B01010101, 166 | B10101010, 167 | B01010101, 168 | B10101010, 169 | B01010101, 170 | B10101010, 171 | }, 172 | 173 | { // 2: smiley 174 | B00111100, 175 | B01000010, 176 | B10100101, 177 | B10000001, 178 | B10100101, 179 | B10011001, 180 | B01000010, 181 | B00111100 }, 182 | 183 | { // 3: neutral 184 | B00111100, 185 | B01000010, 186 | B10100101, 187 | B10000001, 188 | B10111101, 189 | B10000001, 190 | B01000010, 191 | B00111100 }, 192 | 193 | { // 4; frowny 194 | B00111100, 195 | B01000010, 196 | B10100101, 197 | B10000001, 198 | B10011001, 199 | B10100101, 200 | B01000010, 201 | B00111100 }, 202 | }; 203 | 204 | static const uint16_t PROGMEM 205 | // These bitmaps were written for a backend that only supported 206 | // 4 bits per color with Blue/Green/Red ordering while neomatrix 207 | // uses native 565 color mapping as RGB. 208 | // I'm leaving the arrays as is because it's easier to read 209 | // which color is what when separated on a 4bit boundary 210 | // The demo code will modify the arrays at runtime to be compatible 211 | // with the neomatrix color ordering and bit depth. 212 | RGB_bmp[][64] = { 213 | // 00: blue, blue/red, red, red/green, green, green/blue, blue, white 214 | { 0x100, 0x200, 0x300, 0x400, 0x600, 0x800, 0xA00, 0xF00, 215 | 0x101, 0x202, 0x303, 0x404, 0x606, 0x808, 0xA0A, 0xF0F, 216 | 0x001, 0x002, 0x003, 0x004, 0x006, 0x008, 0x00A, 0x00F, 217 | 0x011, 0x022, 0x033, 0x044, 0x066, 0x088, 0x0AA, 0x0FF, 218 | 0x010, 0x020, 0x030, 0x040, 0x060, 0x080, 0x0A0, 0x0F0, 219 | 0x110, 0x220, 0x330, 0x440, 0x660, 0x880, 0xAA0, 0xFF0, 220 | 0x100, 0x200, 0x300, 0x400, 0x600, 0x800, 0xA00, 0xF00, 221 | 0x111, 0x222, 0x333, 0x444, 0x666, 0x888, 0xAAA, 0xFFF, }, 222 | 223 | // 01: grey to white 224 | { 0x111, 0x222, 0x333, 0x555, 0x777, 0x999, 0xAAA, 0xFFF, 225 | 0x222, 0x222, 0x333, 0x555, 0x777, 0x999, 0xAAA, 0xFFF, 226 | 0x333, 0x333, 0x333, 0x555, 0x777, 0x999, 0xAAA, 0xFFF, 227 | 0x555, 0x555, 0x555, 0x555, 0x777, 0x999, 0xAAA, 0xFFF, 228 | 0x777, 0x777, 0x777, 0x777, 0x777, 0x999, 0xAAA, 0xFFF, 229 | 0x999, 0x999, 0x999, 0x999, 0x999, 0x999, 0xAAA, 0xFFF, 230 | 0xAAA, 0xAAA, 0xAAA, 0xAAA, 0xAAA, 0xAAA, 0xAAA, 0xFFF, 231 | 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, }, 232 | 233 | // 02: low red to high red 234 | { 0x001, 0x002, 0x003, 0x005, 0x007, 0x009, 0x00A, 0x00F, 235 | 0x002, 0x002, 0x003, 0x005, 0x007, 0x009, 0x00A, 0x00F, 236 | 0x003, 0x003, 0x003, 0x005, 0x007, 0x009, 0x00A, 0x00F, 237 | 0x005, 0x005, 0x005, 0x005, 0x007, 0x009, 0x00A, 0x00F, 238 | 0x007, 0x007, 0x007, 0x007, 0x007, 0x009, 0x00A, 0x00F, 239 | 0x009, 0x009, 0x009, 0x009, 0x009, 0x009, 0x00A, 0x00F, 240 | 0x00A, 0x00A, 0x00A, 0x00A, 0x00A, 0x00A, 0x00A, 0x00F, 241 | 0x00F, 0x00F, 0x00F, 0x00F, 0x00F, 0x00F, 0x00F, 0x00F, }, 242 | 243 | // 03: low green to high green 244 | { 0x010, 0x020, 0x030, 0x050, 0x070, 0x090, 0x0A0, 0x0F0, 245 | 0x020, 0x020, 0x030, 0x050, 0x070, 0x090, 0x0A0, 0x0F0, 246 | 0x030, 0x030, 0x030, 0x050, 0x070, 0x090, 0x0A0, 0x0F0, 247 | 0x050, 0x050, 0x050, 0x050, 0x070, 0x090, 0x0A0, 0x0F0, 248 | 0x070, 0x070, 0x070, 0x070, 0x070, 0x090, 0x0A0, 0x0F0, 249 | 0x090, 0x090, 0x090, 0x090, 0x090, 0x090, 0x0A0, 0x0F0, 250 | 0x0A0, 0x0A0, 0x0A0, 0x0A0, 0x0A0, 0x0A0, 0x0A0, 0x0F0, 251 | 0x0F0, 0x0F0, 0x0F0, 0x0F0, 0x0F0, 0x0F0, 0x0F0, 0x0F0, }, 252 | 253 | // 04: low blue to high blue 254 | { 0x100, 0x200, 0x300, 0x500, 0x700, 0x900, 0xA00, 0xF00, 255 | 0x200, 0x200, 0x300, 0x500, 0x700, 0x900, 0xA00, 0xF00, 256 | 0x300, 0x300, 0x300, 0x500, 0x700, 0x900, 0xA00, 0xF00, 257 | 0x500, 0x500, 0x500, 0x500, 0x700, 0x900, 0xA00, 0xF00, 258 | 0x700, 0x700, 0x700, 0x700, 0x700, 0x900, 0xA00, 0xF00, 259 | 0x900, 0x900, 0x900, 0x900, 0x900, 0x900, 0xA00, 0xF00, 260 | 0xA00, 0xA00, 0xA00, 0xA00, 0xA00, 0xA00, 0xA00, 0xF00, 261 | 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, }, 262 | 263 | // 05: 1 black, 2R, 2O, 2G, 1B with 4 blue lines rising right 264 | { 0x000, 0x200, 0x000, 0x400, 0x000, 0x800, 0x000, 0xF00, 265 | 0x000, 0x201, 0x002, 0x403, 0x004, 0x805, 0x006, 0xF07, 266 | 0x008, 0x209, 0x00A, 0x40B, 0x00C, 0x80D, 0x00E, 0xF0F, 267 | 0x000, 0x211, 0x022, 0x433, 0x044, 0x855, 0x066, 0xF77, 268 | 0x088, 0x299, 0x0AA, 0x4BB, 0x0CC, 0x8DD, 0x0EE, 0xFFF, 269 | 0x000, 0x210, 0x020, 0x430, 0x040, 0x850, 0x060, 0xF70, 270 | 0x080, 0x290, 0x0A0, 0x4B0, 0x0C0, 0x8D0, 0x0E0, 0xFF0, 271 | 0x000, 0x200, 0x000, 0x500, 0x000, 0x800, 0x000, 0xF00, }, 272 | 273 | // 06: 4 lines of increasing red and then green 274 | { 0x000, 0x000, 0x001, 0x001, 0x002, 0x002, 0x003, 0x003, 275 | 0x004, 0x004, 0x005, 0x005, 0x006, 0x006, 0x007, 0x007, 276 | 0x008, 0x008, 0x009, 0x009, 0x00A, 0x00A, 0x00B, 0x00B, 277 | 0x00C, 0x00C, 0x00D, 0x00D, 0x00E, 0x00E, 0x00F, 0x00F, 278 | 0x000, 0x000, 0x010, 0x010, 0x020, 0x020, 0x030, 0x030, 279 | 0x040, 0x040, 0x050, 0x050, 0x060, 0x060, 0x070, 0x070, 280 | 0x080, 0x080, 0x090, 0x090, 0x0A0, 0x0A0, 0x0B0, 0x0B0, 281 | 0x0C0, 0x0C0, 0x0D0, 0x0D0, 0x0E0, 0x0E0, 0x0F0, 0x0F0, }, 282 | 283 | // 07: 4 lines of increasing red and then blue 284 | { 0x000, 0x000, 0x001, 0x001, 0x002, 0x002, 0x003, 0x003, 285 | 0x004, 0x004, 0x005, 0x005, 0x006, 0x006, 0x007, 0x007, 286 | 0x008, 0x008, 0x009, 0x009, 0x00A, 0x00A, 0x00B, 0x00B, 287 | 0x00C, 0x00C, 0x00D, 0x00D, 0x00E, 0x00E, 0x00F, 0x00F, 288 | 0x000, 0x000, 0x100, 0x100, 0x200, 0x200, 0x300, 0x300, 289 | 0x400, 0x400, 0x500, 0x500, 0x600, 0x600, 0x700, 0x700, 290 | 0x800, 0x800, 0x900, 0x900, 0xA00, 0xA00, 0xB00, 0xB00, 291 | 0xC00, 0xC00, 0xD00, 0xD00, 0xE00, 0xE00, 0xF00, 0xF00, }, 292 | 293 | // 08: criss cross of green and red with diagonal blue. 294 | { 0xF00, 0x001, 0x003, 0x005, 0x007, 0x00A, 0x00F, 0x000, 295 | 0x020, 0xF21, 0x023, 0x025, 0x027, 0x02A, 0x02F, 0x020, 296 | 0x040, 0x041, 0xF43, 0x045, 0x047, 0x04A, 0x04F, 0x040, 297 | 0x060, 0x061, 0x063, 0xF65, 0x067, 0x06A, 0x06F, 0x060, 298 | 0x080, 0x081, 0x083, 0x085, 0xF87, 0x08A, 0x08F, 0x080, 299 | 0x0A0, 0x0A1, 0x0A3, 0x0A5, 0x0A7, 0xFAA, 0x0AF, 0x0A0, 300 | 0x0F0, 0x0F1, 0x0F3, 0x0F5, 0x0F7, 0x0FA, 0xFFF, 0x0F0, 301 | 0x000, 0x001, 0x003, 0x005, 0x007, 0x00A, 0x00F, 0xF00, }, 302 | 303 | // 09: 2 lines of green, 2 red, 2 orange, 2 green 304 | { 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 305 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 306 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 307 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 308 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 309 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 310 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 311 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, }, 312 | 313 | // 10: multicolor smiley face 314 | { 0x000, 0x000, 0x00F, 0x00F, 0x00F, 0x00F, 0x000, 0x000, 315 | 0x000, 0x00F, 0x000, 0x000, 0x000, 0x000, 0x00F, 0x000, 316 | 0x00F, 0x000, 0xF00, 0x000, 0x000, 0xF00, 0x000, 0x00F, 317 | 0x00F, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x00F, 318 | 0x00F, 0x000, 0x0F0, 0x000, 0x000, 0x0F0, 0x000, 0x00F, 319 | 0x00F, 0x000, 0x000, 0x0F4, 0x0F3, 0x000, 0x000, 0x00F, 320 | 0x000, 0x00F, 0x000, 0x000, 0x000, 0x000, 0x00F, 0x000, 321 | 0x000, 0x000, 0x00F, 0x00F, 0x00F, 0x00F, 0x000, 0x000, }, 322 | }; 323 | 324 | // Convert a BGR 4/4/4 bitmap to RGB 5/6/5 used by Adafruit_GFX 325 | void fixdrawRGBBitmap(int16_t x, int16_t y, const uint16_t *bitmap, int16_t w, int16_t h) { 326 | // work around "a15 cannot be used in asm here" compiler bug when using an array on ESP8266 327 | // uint16_t RGB_bmp_fixed[w * h]; 328 | static uint16_t *RGB_bmp_fixed = (uint16_t *) malloc( w*h*2); 329 | for (uint16_t pixel=0; pixel> 8; 335 | g = (color & 0x0F0) >> 4; 336 | r = color & 0x00F; 337 | //Serial.print(" "); 338 | //Serial.print(b); 339 | //Serial.print("/"); 340 | //Serial.print(g); 341 | //Serial.print("/"); 342 | //Serial.print(r); 343 | //Serial.print(" -> "); 344 | // expand from 4/4/4 bits per color to 5/6/5 345 | b = map(b, 0, 15, 0, 31); 346 | g = map(g, 0, 15, 0, 63); 347 | r = map(r, 0, 15, 0, 31); 348 | //Serial.print(r); 349 | //Serial.print("/"); 350 | //Serial.print(g); 351 | //Serial.print("/"); 352 | //Serial.print(b); 353 | RGB_bmp_fixed[pixel] = (r << 11) + (g << 5) + b; 354 | //Serial.print(" -> "); 355 | //Serial.println(RGB_bmp_fixed[pixel], HEX); 356 | } 357 | matrix->drawRGBBitmap(x, y, RGB_bmp_fixed, w, h); 358 | } 359 | 360 | // In a case of a tile of neomatrices, this test is helpful to make sure that the 361 | // pixels are all in sequence (to check your wiring order and the tile options you 362 | // gave to the constructor). 363 | void count_pixels() { 364 | matrix->clear(); 365 | for (uint16_t i=0; idrawPixel(j, i, i%3==0?(uint16_t)LED_BLUE_HIGH:i%3==1?(uint16_t)LED_RED_HIGH:(uint16_t)LED_GREEN_HIGH); 368 | // depending on the matrix size, it's too slow to display each pixel, so 369 | // make the scan init faster. This will however be too fast on a small matrix. 370 | #ifdef ESP8266 371 | if (!(j%3)) matrix->show(); 372 | yield(); // reset watchdog timer 373 | #elif ESP32 374 | delay(1); 375 | matrix->show(); 376 | #else 377 | matrix->show(); 378 | #endif 379 | } 380 | } 381 | } 382 | 383 | // Fill the screen with multiple levels of white to gauge the quality 384 | void display_four_white() { 385 | matrix->clear(); 386 | matrix->fillRect(0,0, mw,mh, LED_WHITE_HIGH); 387 | matrix->drawRect(1,1, mw-2,mh-2, LED_WHITE_MEDIUM); 388 | matrix->drawRect(2,2, mw-4,mh-4, LED_WHITE_LOW); 389 | matrix->drawRect(3,3, mw-6,mh-6, LED_WHITE_VERYLOW); 390 | matrix->show(); 391 | } 392 | 393 | void display_bitmap(uint8_t bmp_num, uint16_t color) { 394 | static uint16_t bmx,bmy; 395 | 396 | // Clear the space under the bitmap that will be drawn as 397 | // drawing a single color pixmap does not write over pixels 398 | // that are nul, and leaves the data that was underneath 399 | matrix->fillRect(bmx,bmy, bmx+8,bmy+8, LED_BLACK); 400 | matrix->drawBitmap(bmx, bmy, mono_bmp[bmp_num], 8, 8, color); 401 | bmx += 8; 402 | if (bmx >= mw) bmx = 0; 403 | if (!bmx) bmy += 8; 404 | if (bmy >= mh) bmy = 0; 405 | matrix->show(); 406 | } 407 | 408 | void display_rgbBitmap(uint8_t bmp_num) { 409 | static uint16_t bmx,bmy; 410 | 411 | fixdrawRGBBitmap(bmx, bmy, RGB_bmp[bmp_num], 8, 8); 412 | bmx += 8; 413 | if (bmx >= mw) bmx = 0; 414 | if (!bmx) bmy += 8; 415 | if (bmy >= mh) bmy = 0; 416 | matrix->show(); 417 | } 418 | 419 | void display_lines() { 420 | matrix->clear(); 421 | 422 | // 4 levels of crossing red lines. 423 | matrix->drawLine(0,mh/2-2, mw-1,2, LED_RED_VERYLOW); 424 | matrix->drawLine(0,mh/2-1, mw-1,3, LED_RED_LOW); 425 | matrix->drawLine(0,mh/2, mw-1,mh/2, LED_RED_MEDIUM); 426 | matrix->drawLine(0,mh/2+1, mw-1,mh/2+1, LED_RED_HIGH); 427 | 428 | // 4 levels of crossing green lines. 429 | matrix->drawLine(mw/2-2, 0, mw/2-2, mh-1, LED_GREEN_VERYLOW); 430 | matrix->drawLine(mw/2-1, 0, mw/2-1, mh-1, LED_GREEN_LOW); 431 | matrix->drawLine(mw/2+0, 0, mw/2+0, mh-1, LED_GREEN_MEDIUM); 432 | matrix->drawLine(mw/2+1, 0, mw/2+1, mh-1, LED_GREEN_HIGH); 433 | 434 | // Diagonal blue line. 435 | matrix->drawLine(0,0, mw-1,mh-1, LED_BLUE_HIGH); 436 | matrix->drawLine(0,mh-1, mw-1,0, LED_ORANGE_MEDIUM); 437 | matrix->show(); 438 | } 439 | 440 | void display_boxes() { 441 | matrix->clear(); 442 | matrix->drawRect(0,0, mw,mh, LED_BLUE_HIGH); 443 | matrix->drawRect(1,1, mw-2,mh-2, LED_GREEN_MEDIUM); 444 | matrix->fillRect(2,2, mw-4,mh-4, LED_RED_HIGH); 445 | matrix->fillRect(3,3, mw-6,mh-6, LED_ORANGE_MEDIUM); 446 | matrix->show(); 447 | } 448 | 449 | void display_circles() { 450 | matrix->clear(); 451 | matrix->drawCircle(mw/2,mh/2, 2, LED_RED_MEDIUM); 452 | matrix->drawCircle(mw/2-1-min(mw,mh)/8, mh/2-1-min(mw,mh)/8, min(mw,mh)/4, LED_BLUE_HIGH); 453 | matrix->drawCircle(mw/2+1+min(mw,mh)/8, mh/2+1+min(mw,mh)/8, min(mw,mh)/4-1, LED_ORANGE_MEDIUM); 454 | matrix->drawCircle(1,mh-2, 1, LED_GREEN_LOW); 455 | matrix->drawCircle(mw-2,1, 1, LED_GREEN_HIGH); 456 | if (min(mw,mh)>12) matrix->drawCircle(mw/2-1, mh/2-1, min(mh/2-1,mw/2-1), LED_CYAN_HIGH); 457 | matrix->show(); 458 | } 459 | 460 | void display_resolution() { 461 | matrix->setTextSize(1); 462 | // not wide enough; 463 | if (mw<16) return; 464 | matrix->clear(); 465 | // Font is 5x7, if display is too small 466 | // 8 can only display 1 char 467 | // 16 can almost display 3 chars 468 | // 24 can display 4 chars 469 | // 32 can display 5 chars 470 | matrix->setCursor(0, 0); 471 | matrix->setTextColor(matrix->Color(255,0,0)); 472 | if (mw>10) matrix->print(mw/10); 473 | matrix->setTextColor(matrix->Color(255,128,0)); 474 | matrix->print(mw % 10); 475 | matrix->setTextColor(matrix->Color(0,255,0)); 476 | matrix->print('x'); 477 | // not wide enough to print 5 chars, go to next line 478 | if (mw<25) { 479 | if (mh==13) matrix->setCursor(6, 7); 480 | else if (mh>=13) { 481 | matrix->setCursor(mw-11, 8); 482 | } else { 483 | // we're not tall enough either, so we wait and display 484 | // the 2nd value on top. 485 | matrix->show(); 486 | delay(2000); 487 | matrix->clear(); 488 | matrix->setCursor(mw-11, 0); 489 | } 490 | } 491 | matrix->setTextColor(matrix->Color(0,255,128)); 492 | matrix->print(mh/10); 493 | matrix->setTextColor(matrix->Color(0,128,255)); 494 | matrix->print(mh % 10); 495 | // enough room for a 2nd line 496 | if ((mw>25 && mh >14) || mh>16) { 497 | matrix->setCursor(0, mh-7); 498 | matrix->setTextColor(matrix->Color(0,255,255)); 499 | if (mw>16) matrix->print('*'); 500 | matrix->setTextColor(matrix->Color(255,0,0)); 501 | matrix->print('R'); 502 | matrix->setTextColor(matrix->Color(0,255,0)); 503 | matrix->print('G'); 504 | matrix->setTextColor(matrix->Color(0,0,255)); 505 | matrix->print("B"); 506 | matrix->setTextColor(matrix->Color(255,255,0)); 507 | // this one could be displayed off screen, but we don't care :) 508 | matrix->print("*"); 509 | 510 | // We have a big array, great, let's assume 32x32 and add something in the middle 511 | if (mh>24 && mw>25) { 512 | for (uint16_t i=0; ishow(); 517 | } 518 | 519 | void display_scrollText() { 520 | uint8_t size = max(int(mw/8), 1); 521 | matrix->clear(); 522 | matrix->setTextWrap(false); // we don't wrap text so it scrolls nicely 523 | matrix->setTextSize(1); 524 | matrix->setRotation(0); 525 | for (int8_t x=7; x>=-42; x--) { 526 | yield(); 527 | matrix->clear(); 528 | matrix->setCursor(x,0); 529 | matrix->setTextColor(LED_GREEN_HIGH); 530 | matrix->print("Hello"); 531 | if (mh>11) { 532 | matrix->setCursor(-20-x,mh-7); 533 | matrix->setTextColor(LED_ORANGE_HIGH); 534 | matrix->print("World"); 535 | } 536 | matrix->show(); 537 | delay(50); 538 | } 539 | 540 | matrix->setRotation(3); 541 | matrix->setTextSize(size); 542 | matrix->setTextColor(LED_BLUE_HIGH); 543 | for (int16_t x=8*size; x>=-6*8*size; x--) { 544 | yield(); 545 | matrix->clear(); 546 | matrix->setCursor(x,mw/2-size*4); 547 | matrix->print("Rotate"); 548 | matrix->show(); 549 | // note that on a big array the refresh rate from show() will be slow enough that 550 | // the delay become irrelevant. This is already true on a 32x32 array. 551 | delay(50/size); 552 | } 553 | matrix->setRotation(0); 554 | matrix->setCursor(0,0); 555 | matrix->show(); 556 | } 557 | 558 | // Scroll within big bitmap so that all if it becomes visible or bounce a small one. 559 | // If the bitmap is bigger in one dimension and smaller in the other one, it will 560 | // be both panned and bounced in the appropriate dimensions. 561 | void display_panOrBounceBitmap (uint8_t bitmapSize) { 562 | // keep integer math, deal with values 16 times too big 563 | // start by showing upper left of big bitmap or centering if the display is big 564 | int16_t xf = max(0, (mw-bitmapSize)/2) << 4; 565 | int16_t yf = max(0, (mh-bitmapSize)/2) << 4; 566 | // scroll speed in 1/16th 567 | int16_t xfc = 6; 568 | int16_t yfc = 3; 569 | // scroll down and right by moving upper left corner off screen 570 | // more up and left (which means negative numbers) 571 | int16_t xfdir = -1; 572 | int16_t yfdir = -1; 573 | 574 | for (uint16_t i=1; i<200; i++) { 575 | bool updDir = false; 576 | 577 | // Get actual x/y by dividing by 16. 578 | int16_t x = xf >> 4; 579 | int16_t y = yf >> 4; 580 | 581 | matrix->clear(); 582 | // bounce 8x8 tri color smiley face around the screen 583 | if (bitmapSize == 8) fixdrawRGBBitmap(x, y, RGB_bmp[10], 8, 8); 584 | // pan 24x24 pixmap 585 | if (bitmapSize == 24) matrix->drawRGBBitmap(x, y, (const uint16_t *) bitmap24, bitmapSize, bitmapSize); 586 | #ifdef BM32 587 | if (bitmapSize == 32) matrix->drawRGBBitmap(x, y, (const uint16_t *) bitmap32, bitmapSize, bitmapSize); 588 | #endif 589 | matrix->show(); 590 | 591 | // Only pan if the display size is smaller than the pixmap 592 | // but not if the difference is too small or it'll look bad. 593 | if (bitmapSize-mw>2) { 594 | xf += xfc*xfdir; 595 | if (xf >= 0) { xfdir = -1; updDir = true ; }; 596 | // we don't go negative past right corner, go back positive 597 | if (xf <= ((mw-bitmapSize) << 4)) { xfdir = 1; updDir = true ; }; 598 | } 599 | if (bitmapSize-mh>2) { 600 | yf += yfc*yfdir; 601 | // we shouldn't display past left corner, reverse direction. 602 | if (yf >= 0) { yfdir = -1; updDir = true ; }; 603 | if (yf <= ((mh-bitmapSize) << 4)) { yfdir = 1; updDir = true ; }; 604 | } 605 | // only bounce a pixmap if it's smaller than the display size 606 | if (mw>bitmapSize) { 607 | xf += xfc*xfdir; 608 | // Deal with bouncing off the 'walls' 609 | if (xf >= (mw-bitmapSize) << 4) { xfdir = -1; updDir = true ; }; 610 | if (xf <= 0) { xfdir = 1; updDir = true ; }; 611 | } 612 | if (mh>bitmapSize) { 613 | yf += yfc*yfdir; 614 | if (yf >= (mh-bitmapSize) << 4) { yfdir = -1; updDir = true ; }; 615 | if (yf <= 0) { yfdir = 1; updDir = true ; }; 616 | } 617 | 618 | if (updDir) { 619 | // Add -1, 0 or 1 but bind result to 1 to 1. 620 | // Let's take 3 is a minimum speed, otherwise it's too slow. 621 | xfc = constrain(xfc + random(-1, 2), 3, 16); 622 | yfc = constrain(xfc + random(-1, 2), 3, 16); 623 | } 624 | delay(10); 625 | } 626 | } 627 | 628 | 629 | void loop() { 630 | // clear the screen after X bitmaps have been displayed and we 631 | // loop back to the top left corner 632 | // 8x8 => 1, 16x8 => 2, 17x9 => 6 633 | static uint8_t pixmap_count = ((mw+7)/8) * ((mh+7)/8); 634 | 635 | // You can't use millis to time frame fresh rate because it uses cli() which breaks millis() 636 | // So I use my stopwatch to count 200 displays and that's good enough 637 | #if 0 638 | // 200 displays in 13 seconds = 15 frames per second for 4096 pixels 639 | for (uint8_t i=0; i<100; i++) { 640 | matrix->fillScreen(LED_BLUE_LOW); 641 | matrix->show(); 642 | matrix->fillScreen(LED_RED_LOW); 643 | matrix->show(); 644 | } 645 | #endif 646 | 647 | Serial.println("Count pixels"); 648 | count_pixels(); 649 | Serial.println("Count pixels done"); 650 | delay(1000); 651 | 652 | display_four_white(); 653 | delay(3000); 654 | 655 | Serial.print("Screen pixmap capacity: "); 656 | Serial.println(pixmap_count); 657 | 658 | // multicolor bitmap sent as many times as we can display an 8x8 pixmap 659 | for (uint8_t i=0; i<=pixmap_count; i++) 660 | { 661 | display_rgbBitmap(0); 662 | } 663 | delay(1000); 664 | 665 | Serial.println("Display Resolution"); 666 | display_resolution(); 667 | delay(3000); 668 | 669 | Serial.println("Display bitmaps"); 670 | // Cycle through red, green, blue, display 2 checkered patterns 671 | // useful to debug some screen types and alignment. 672 | uint16_t bmpcolor[] = { LED_GREEN_HIGH, LED_BLUE_HIGH, LED_RED_HIGH }; 673 | for (uint8_t i=0; i<3; i++) 674 | { 675 | display_bitmap(0, bmpcolor[i]); 676 | delay(500); 677 | display_bitmap(1, bmpcolor[i]); 678 | delay(500); 679 | } 680 | 681 | Serial.println("Display smileys"); 682 | // Display 3 smiley faces. 683 | for (uint8_t i=2; i<=4; i++) 684 | { 685 | display_bitmap(i, bmpcolor[i-2]); 686 | // If more than one pixmap displayed per screen, display more quickly. 687 | delay(mw>8?500:1500); 688 | } 689 | // If we have multiple pixmaps displayed at once, wait a bit longer on the last. 690 | delay(mw>8?1000:500); 691 | 692 | Serial.println("Display lines, boxes and circles"); 693 | display_lines(); 694 | delay(3000); 695 | 696 | display_boxes(); 697 | delay(3000); 698 | 699 | display_circles(); 700 | delay(3000); 701 | matrix->clear(); 702 | 703 | Serial.println("Display RGB bitmaps"); 704 | for (uint8_t i=0; i<=(sizeof(RGB_bmp)/sizeof(RGB_bmp[0])-1); i++) 705 | { 706 | display_rgbBitmap(i); 707 | delay(mw>8?500:1500); 708 | } 709 | // If we have multiple pixmaps displayed at once, wait a bit longer on the last. 710 | delay(mw>8?1000:500); 711 | 712 | Serial.println("Scrolltext"); 713 | display_scrollText(); 714 | 715 | #ifdef BM32 716 | Serial.println("bounce 32 bitmap"); 717 | display_panOrBounceBitmap(32); 718 | #endif 719 | // pan a big pixmap 720 | Serial.println("pan/bounce 24 bitmap"); 721 | display_panOrBounceBitmap(24); 722 | // bounce around a small one 723 | Serial.println("pan/bounce 8 bitmap"); 724 | display_panOrBounceBitmap(8); 725 | 726 | Serial.println("Demo loop done, starting over"); 727 | } 728 | 729 | void setup() { 730 | // Time for serial port to work? 731 | delay(1000); 732 | Serial.begin(115200); 733 | Serial.print("Init on pin: "); 734 | Serial.println(PIN); 735 | Serial.print("Matrix Size: "); 736 | Serial.print(mw); 737 | Serial.print(" "); 738 | Serial.print(mh); 739 | Serial.print(" "); 740 | Serial.println(NUMMATRIX); 741 | 742 | #if defined(P32BY8X3) 743 | // Parallel output 744 | FastLED.addLeds(leds, NUMMATRIX/3).setCorrection(TypicalLEDStrip); 745 | Serial.print("Setup parrallel WS2811_PORTA: "); 746 | Serial.print(NUMMATRIX); 747 | #else 748 | FastLED.addLeds( leds, NUMMATRIX ).setCorrection(TypicalLEDStrip); 749 | Serial.print("Setup serial: "); 750 | Serial.println(NUMMATRIX); 751 | #endif 752 | 753 | matrix->begin(); 754 | matrix->setTextWrap(false); 755 | matrix->setBrightness(BRIGHTNESS); 756 | Serial.println("If the code crashes here, decrease the brightness or turn off the all white display below"); 757 | // Test full bright of all LEDs. If brightness is too high 758 | // for your current limit (i.e. USB), decrease it. 759 | //#define DISABLE_WHITE 760 | #ifndef DISABLE_WHITE 761 | matrix->fillScreen(LED_WHITE_HIGH); 762 | matrix->show(); 763 | delay(3000); 764 | matrix->clear(); 765 | #endif 766 | } 767 | 768 | // vim:sts=4:sw=4 769 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo/README.md: -------------------------------------------------------------------------------- 1 | This is my hello world GFX demo inspired by some old Adafruit code. 2 | 3 | It is present in some form in these trees: 4 | * https://github.com/marcmerlin/LED-Matrix/blob/master/examples/directmatrix8x8_tricolor_direct_sr/directmatrix8x8_tricolor_direct_sr.ino 5 | * https://github.com/adafruit/Adafruit_NeoMatrix/tree/master/examples/MatrixGFXDemo 6 | * https://github.com/adafruit/RGB-matrix-Panel/blob/master/examples/PanelGFXDemo_16x32/PanelGFXDemo_16x32.ino- 7 | * https://github.com/marcmerlin/FastLED_NeoMatrix/tree/master/examples/MatrixGFXDemo 8 | * https://github.com/mrfaptastic/ESP32-RGB64x32MatrixPanel-I2S-DMA/blob/master/examples/PanelGFXDemo/PanelGFXDemo.ino 9 | * https://github.com/marcmerlin/SmartMatrix_GFX/tree/master/examples/MatrixGFXDemo 10 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo/bluesmiley24.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : bluesmiley24.jpg 3 | // Time generated : 2017-04-23 04:27:05.368571 UTC 4 | // Image Size : 24x24 pixels 5 | // Memory usage : 1152 bytes 6 | 7 | #if defined(__AVR__) 8 | #include 9 | #elif defined(__PIC32MX__) 10 | #define PROGMEM 11 | #elif defined(__arm__) 12 | #define PROGMEM 13 | #endif 14 | 15 | const unsigned short bitmap24[576] PROGMEM={ 16 | 0x0000, 0x0040, 0x0020, 0x0802, 0x0802, 0x0001, 0x0041, 0x0020, 0x0002, 0x1002, 0x0801, 0x0020, 0x0800, 0x0000, 0x0040, 0x0060, // 0x0010 (16) pixels 17 | 0x0800, 0x0000, 0x0001, 0x0001, 0x0800, 0x0800, 0x0000, 0x1000, 0x0020, 0x0000, 0x0000, 0x0042, 0x0020, 0x0000, 0x0801, 0x0000, // 0x0020 (32) pixels 18 | 0x0020, 0x0800, 0x0000, 0x0000, 0x2000, 0x0000, 0x0060, 0x0000, 0x0000, 0x0021, 0x0020, 0x0000, 0x0041, 0x0001, 0x0001, 0x0001, // 0x0030 (48) pixels 19 | 0x0000, 0x0800, 0x1021, 0x0000, 0x0020, 0x0020, 0x0000, 0x0000, 0x0040, 0x0020, 0x0001, 0x0043, 0x0002, 0x0022, 0x0021, 0x1000, // 0x0040 (64) pixels 20 | 0x0801, 0x0000, 0x0000, 0x0000, 0x0021, 0x0061, 0x0000, 0x0041, 0x0801, 0x0000, 0x0000, 0x0800, 0x0000, 0x0020, 0x0000, 0x1881, // 0x0050 (80) pixels 21 | 0x18E2, 0x0189, 0x23F7, 0x1BD8, 0x03F8, 0x33D7, 0x00E9, 0x0044, 0x0001, 0x1020, 0x0000, 0x0001, 0x0000, 0x0800, 0x0000, 0x0000, // 0x0060 (96) pixels 22 | 0x0801, 0x0040, 0x0020, 0x0000, 0x0021, 0x0001, 0x0000, 0xBDB7, 0x9F5F, 0x4E3E, 0x261F, 0x0CDB, 0x047A, 0x2C7C, 0x1338, 0x02D4, // 0x0070 (112) pixels 23 | 0x0969, 0x0000, 0x0000, 0x0821, 0x0800, 0x0800, 0x0801, 0x0801, 0x0800, 0x0021, 0x0021, 0x0000, 0x0000, 0x0000, 0xCF5D, 0xA7BF, // 0x0080 (128) pixels 24 | 0x2E9E, 0x1E3E, 0x261F, 0x051B, 0x5E3F, 0x0418, 0x0337, 0x453F, 0x0233, 0x11EF, 0x0002, 0x0800, 0x0000, 0x0041, 0x0000, 0x0000, // 0x0090 (144) pixels 25 | 0x0800, 0x0001, 0x0000, 0x0800, 0x0001, 0xC6DC, 0xD7FF, 0x6F5D, 0x2EBF, 0x4E3D, 0x4D5A, 0x15BC, 0x3C7A, 0x5DFB, 0x3437, 0x02D7, // 0x00A0 (160) pixels 26 | 0x0255, 0x54FE, 0x11AD, 0x0043, 0x0001, 0x0020, 0x0000, 0x0020, 0x0800, 0x0041, 0x0020, 0x0862, 0x7D16, 0xB77F, 0xA69B, 0x969B, // 0x00B0 (176) pixels 27 | 0x53B0, 0xADB5, 0xAEDC, 0x25DD, 0x5D3C, 0xADB6, 0x836D, 0xA61C, 0x3B74, 0x12B2, 0x1B34, 0x09CC, 0x0001, 0x0000, 0x0022, 0x0001, // 0x00C0 (192) pixels 28 | 0x0800, 0x0001, 0x0020, 0x1064, 0x6DFC, 0x659A, 0xAE7B, 0xE75F, 0x18E7, 0x3206, 0x5D76, 0x159E, 0x34DC, 0x5391, 0x18E5, 0x8D58, // 0x00D0 (208) pixels 29 | 0xD7FF, 0x74FA, 0x341B, 0x0211, 0x0063, 0x0820, 0x0001, 0x0802, 0x0000, 0x0800, 0x0822, 0x3C97, 0x35BD, 0x565E, 0x763D, 0x2D18, // 0x00E0 (224) pixels 30 | 0x0D5B, 0x255A, 0x359C, 0x155B, 0x3DDF, 0x24BC, 0x1B97, 0x54D9, 0x5436, 0x7E5F, 0x0252, 0x3C3B, 0x122E, 0x0000, 0x0020, 0x0001, // 0x00F0 (240) pixels 31 | 0x0800, 0x0020, 0x0004, 0x1419, 0x24FC, 0x1457, 0x3CB9, 0x2D1A, 0x2DBC, 0x3DFD, 0x4DBD, 0x4D7B, 0x557A, 0x4D7B, 0x4CDB, 0x6CDB, // 0x0100 (256) pixels 32 | 0x3BD6, 0x2373, 0x3313, 0x0AF6, 0x0AD3, 0x0020, 0x0820, 0x0022, 0x0800, 0x0020, 0x1A6F, 0x1337, 0x3418, 0x6D5B, 0x967E, 0xBF1F, // 0x0110 (272) pixels 33 | 0xE71D, 0xEF7E, 0xE75E, 0xEFBF, 0xE77E, 0xEF9D, 0xF79E, 0xEF5E, 0xC7DF, 0xBEDF, 0x7D7A, 0x4CBB, 0x2B34, 0x0022, 0x0800, 0x0002, // 0x0120 (288) pixels 34 | 0x0000, 0x0001, 0x124F, 0x12D5, 0x4C9A, 0x9DFB, 0xD7BE, 0xE7DF, 0xFFDF, 0xFF7F, 0xFF9F, 0xEF9F, 0xEFFF, 0xEFBF, 0xF7FE, 0xEFDC, // 0x0130 (304) pixels 35 | 0xF7FE, 0xD77F, 0x7557, 0x3C17, 0x3B55, 0x0002, 0x1000, 0x0001, 0x0001, 0x1001, 0x1A4D, 0x0A74, 0x2B58, 0x6CF6, 0xE7FE, 0xEFDF, // 0x0140 (320) pixels 36 | 0xE7BE, 0xE79F, 0xE7DF, 0xE77E, 0xD79F, 0xE77E, 0xE75D, 0xEF9E, 0xEFBF, 0xD77F, 0x7434, 0x0292, 0x44DA, 0x0002, 0x0800, 0x0061, // 0x0150 (336) pixels 37 | 0x0001, 0x0000, 0x0044, 0x0A33, 0x1277, 0x3B93, 0xC6DB, 0xE6FE, 0xD6FD, 0xD77F, 0xB6FC, 0xCF1D, 0xBEFC, 0xCEBA, 0xD6FC, 0xD6DF, // 0x0160 (352) pixels 38 | 0xD79F, 0xADFA, 0x5334, 0x0B58, 0x4D7C, 0x0000, 0x0820, 0x0040, 0x0022, 0x0000, 0x0003, 0x0A11, 0x0213, 0x11EF, 0x8D16, 0xE75E, // 0x0170 (368) pixels 39 | 0xDF3F, 0xDF1F, 0xE79F, 0xEF7E, 0xDFDF, 0xE75F, 0xDF5E, 0xCF9F, 0xE73D, 0x7CB6, 0x02B3, 0x13FC, 0x8DBE, 0x0040, 0x0020, 0x0021, // 0x0180 (384) pixels 40 | 0x0043, 0x0000, 0x0801, 0x012B, 0x0234, 0x0232, 0x2A6F, 0xC6BD, 0xDFDF, 0xD75F, 0xD77F, 0xCF7F, 0xD77F, 0xDF5E, 0xD77D, 0xD7FE, // 0x0190 (400) pixels 41 | 0xCE7E, 0x2B16, 0x041C, 0x459F, 0x0025, 0x0820, 0x0040, 0x0001, 0x0000, 0x0000, 0x1000, 0x0844, 0x120F, 0x0253, 0x0253, 0x2291, // 0x01A0 (416) pixels 42 | 0xA61A, 0xD75F, 0xCF7E, 0xCFBE, 0xCF9F, 0xD75F, 0xCF5F, 0xA6DE, 0x3C99, 0x041B, 0x353F, 0x3311, 0x0020, 0x0000, 0x0001, 0x0801, // 0x01B0 (432) pixels 43 | 0x0820, 0x0000, 0x0000, 0x0800, 0x0002, 0x0A30, 0x02D7, 0x0275, 0x01B2, 0x2AB4, 0x6478, 0x6CF8, 0x6D1A, 0x5C7B, 0x33DB, 0x0338, // 0x01C0 (448) pixels 44 | 0x041C, 0x361F, 0x4C96, 0x0001, 0x0840, 0x0021, 0x0800, 0x0000, 0x0000, 0x0000, 0x0041, 0x0000, 0x1000, 0x18A5, 0x4375, 0x23DA, // 0x01D0 (464) pixels 45 | 0x035D, 0x035B, 0x035A, 0x0B7A, 0x031A, 0x033B, 0x033B, 0x24FF, 0x555F, 0x33B0, 0x08E2, 0x0821, 0x0001, 0x0820, 0x0800, 0x0020, // 0x01E0 (480) pixels 46 | 0x0021, 0x0001, 0x0801, 0x0000, 0x0000, 0x0800, 0x0042, 0x198B, 0x2418, 0x253C, 0x0CFD, 0x0C3D, 0x247F, 0x34FF, 0x5DBD, 0x43F4, // 0x01F0 (496) pixels 47 | 0x1106, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0001, 0x0800, 0x0000, 0x0000, 0x0021, 0x0000, 0x0800, 0x1000, // 0x0200 (512) pixels 48 | 0x0042, 0x01A7, 0x1AEE, 0x2B11, 0x2AF1, 0x22CF, 0x00C3, 0x0800, 0x0801, 0x0021, 0x0022, 0x0042, 0x0000, 0x0820, 0x0001, 0x0001, // 0x0210 (528) pixels 49 | 0x0800, 0x0000, 0x0040, 0x0000, 0x0000, 0x0022, 0x0821, 0x0800, 0x1800, 0x0800, 0x0000, 0x0800, 0x0821, 0x0000, 0x0000, 0x0800, // 0x0220 (544) pixels 50 | 0x0002, 0x0061, 0x0020, 0x0001, 0x0001, 0x0000, 0x0021, 0x0000, 0x0000, 0x0021, 0x0000, 0x0021, 0x0021, 0x0020, 0x0000, 0x0001, // 0x0230 (560) pixels 51 | 0x0020, 0x0820, 0x0001, 0x0000, 0x0020, 0x0000, 0x0800, 0x0821, 0x0020, 0x0800, 0x0800, 0x0000, 0x0000, 0x0041, 0x0020, 0x0020, // 0x0240 (576) pixels 52 | }; 53 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo/google32.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : google.jpg 3 | // Time generated : 2018-02-08 06:09:41.424425 UTC 4 | // Image Size : 32x32 pixels 5 | // Memory usage : 2048 bytes 6 | 7 | #if defined(__AVR__) 8 | #include 9 | #elif defined(__PIC32MX__) 10 | #define PROGMEM 11 | #elif defined(__arm__) 12 | #define PROGMEM 13 | #endif 14 | 15 | const unsigned short bitmap32[1024] PROGMEM={ 16 | 0xFFFE, 0xFFFE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, 0xFFDF, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFF, 0xFFFF, 0xFFDF, 0xFFDF, // 0x0010 (16) pixels 17 | 0xFFFF, 0xFFFF, 0xFFDE, 0xFFDE, 0xFFFF, 0xFFFF, 0xFFDF, 0xFFFF, 0xFFFE, 0xFFDE, 0xFFFE, 0xFFFE, 0xFFFF, 0xFFFF, 0xFFBF, 0xFFDF, // 0x0020 (32) pixels 18 | 0xFFFE, 0x0840, 0x0820, 0x0841, 0x0040, 0x0020, 0x1020, 0x0800, 0x0040, 0x0060, 0x0020, 0x0840, 0x0000, 0x0040, 0x1022, 0x0821, // 0x0030 (48) pixels 19 | 0x0861, 0x0020, 0x1020, 0x0800, 0x0820, 0x0820, 0x0001, 0x0821, 0x0800, 0x1020, 0x0820, 0x1040, 0x0041, 0x0021, 0x0821, 0xFFDF, // 0x0040 (64) pixels 20 | 0xFFFF, 0x0021, 0x0042, 0x1926, 0x343A, 0x1B98, 0x02F7, 0x0318, 0x031A, 0x033A, 0x43F8, 0x8E7F, 0xF7DF, 0xEF9F, 0xEF9D, 0xEFBD, // 0x0050 (80) pixels 21 | 0xEBF0, 0x9966, 0xE801, 0xE001, 0xD821, 0xD800, 0xE001, 0xE000, 0xD820, 0xD000, 0xD001, 0xC000, 0x3020, 0x2800, 0x0861, 0xF7FF, // 0x0060 (96) pixels 22 | 0xFFFF, 0x0021, 0x10E5, 0xB5D8, 0x2BF9, 0x0B36, 0x02F7, 0x0338, 0x031A, 0x031A, 0x2315, 0x54BB, 0xE75E, 0xF7FF, 0xF7FE, 0xFFFF, // 0x0070 (112) pixels 23 | 0xFE9B, 0xCAEC, 0xE801, 0xE801, 0xD821, 0xD800, 0xE801, 0xE001, 0xD800, 0xE040, 0xD042, 0xD022, 0x5964, 0x2800, 0x0020, 0xFFFF, // 0x0080 (128) pixels 24 | 0xFFFD, 0x0880, 0xB63C, 0x9D58, 0x0BBB, 0x0339, 0x0B1B, 0x02DB, 0x02F8, 0x0B39, 0x031B, 0x139C, 0x9E1B, 0xE7FF, 0xFFFF, 0xFFDE, // 0x0090 (144) pixels 25 | 0xFFDE, 0xC5B5, 0xF863, 0xE000, 0xE001, 0xE001, 0xD821, 0xD821, 0xE020, 0xD800, 0xF000, 0xF000, 0xC801, 0xC800, 0x0040, 0xFFFE, // 0x00A0 (160) pixels 26 | 0xFFFD, 0x10C0, 0xD71F, 0xA59A, 0x0B9A, 0x0339, 0x0B3C, 0x02FB, 0x0B39, 0x0B19, 0x02FA, 0x0B7C, 0x6C95, 0xD7DF, 0xFFFF, 0xFFDE, // 0x00B0 (176) pixels 27 | 0xFFDE, 0xEEDA, 0xF8C4, 0xE801, 0xE001, 0xE001, 0xE041, 0xD821, 0xE020, 0xE000, 0xF801, 0xF801, 0xD022, 0xC801, 0x0860, 0xFFFD, // 0x00C0 (192) pixels 28 | 0xFFFF, 0x62EB, 0xCF5E, 0x9597, 0x1BB9, 0x1337, 0x02D9, 0x031A, 0x0319, 0x0319, 0x031B, 0x033B, 0x4396, 0xB71F, 0xFFFE, 0xFFFE, // 0x00D0 (208) pixels 29 | 0xFFBF, 0xFF1C, 0xF924, 0xE041, 0xF000, 0xF000, 0xE820, 0xE000, 0xF000, 0xF800, 0xE000, 0xD800, 0xD801, 0xD801, 0x4947, 0xFF9F, // 0x00E0 (224) pixels 30 | 0xFFFF, 0x738D, 0xCF7F, 0xAE7B, 0x23B9, 0x0B37, 0x02FA, 0x0B1A, 0x0339, 0x0339, 0x033C, 0x031B, 0x3B76, 0x963F, 0xFFFE, 0xFFFE, // 0x00F0 (240) pixels 31 | 0xFF9E, 0xFF3D, 0xF945, 0xD820, 0xF801, 0xF800, 0xE800, 0xE820, 0xF800, 0xF800, 0xE821, 0xE020, 0xE001, 0xD800, 0x5167, 0xFF7F, // 0x0100 (256) pixels 32 | 0xFFFF, 0x6B8F, 0xE71D, 0xE6FD, 0x4439, 0x2335, 0x033A, 0x035A, 0x0317, 0x0B58, 0x0319, 0x0319, 0x2B76, 0x7E1F, 0xF7FF, 0xFFFF, // 0x0110 (272) pixels 33 | 0xFF7E, 0xFE7A, 0xE904, 0xD021, 0xB8C2, 0xB8C2, 0xA8C0, 0xB101, 0xC881, 0xC880, 0xF001, 0xF001, 0xE000, 0xD800, 0x5166, 0xFF9E, // 0x0120 (288) pixels 34 | 0xF7BF, 0x73B0, 0xEF3E, 0xF79F, 0x655E, 0x2356, 0x037B, 0x033A, 0x0B58, 0x0316, 0x0319, 0x033A, 0x2356, 0x7E1F, 0xFFFF, 0xF7FF, // 0x0130 (304) pixels 35 | 0xFF9E, 0xCCF4, 0xE0A3, 0xD862, 0xB8C2, 0xC0E2, 0xB942, 0xB101, 0xC8A1, 0xC8A1, 0xF001, 0xF001, 0xD800, 0xD800, 0x5166, 0xFFBF, // 0x0140 (320) pixels 36 | 0xFFFE, 0x6B6C, 0xFEFC, 0xFF7E, 0xAEFF, 0x3B94, 0x039D, 0x033B, 0x0358, 0x0379, 0x033C, 0x035C, 0x3B74, 0x963E, 0xFFFF, 0xFFFF, // 0x0150 (336) pixels 37 | 0xD7FC, 0x5C6D, 0x13C6, 0x1C07, 0x1407, 0x1407, 0x04C8, 0x0487, 0x1BE7, 0x1BE7, 0x3B45, 0x3324, 0xA101, 0xA0C0, 0x4984, 0xFFDD, // 0x0160 (352) pixels 38 | 0xFFFE, 0x73AD, 0xFF1C, 0xFF9E, 0xD7FF, 0x85DD, 0x03BE, 0x039D, 0x0358, 0x0358, 0x035C, 0x035C, 0x5437, 0xBF9F, 0xFFFF, 0xFFBE, // 0x0170 (368) pixels 39 | 0x7D72, 0x3B49, 0x1C07, 0x1C07, 0x1448, 0x1448, 0x04A8, 0x04A8, 0x1C28, 0x1C28, 0x4386, 0x3B86, 0xB142, 0xA101, 0x4984, 0xFFDD, // 0x0180 (384) pixels 40 | 0xFFFF, 0x6350, 0xDFBC, 0xEFFD, 0xFFDE, 0xF77D, 0x853A, 0x4B53, 0x2375, 0x2355, 0x3B34, 0x5C18, 0xC63A, 0xFFFF, 0xCFFC, 0x6E11, // 0x0190 (400) pixels 41 | 0x04A8, 0x0467, 0x04A7, 0x0487, 0x0466, 0x0C86, 0x0486, 0x04A6, 0x0467, 0x0488, 0x04A7, 0x04C7, 0x0447, 0x03E6, 0x41A8, 0xFFDF, // 0x01A0 (416) pixels 42 | 0xFFFF, 0x422B, 0xCF19, 0xEFFD, 0xFFFF, 0xFFFF, 0xE7FF, 0xB69F, 0x6D9E, 0x655D, 0x95DF, 0xC75F, 0xFFDF, 0xFFBF, 0x5D8F, 0x23A8, // 0x01B0 (432) pixels 43 | 0x0487, 0x04A8, 0x04A7, 0x04A7, 0x0466, 0x0C86, 0x04C7, 0x04A6, 0x0488, 0x0488, 0x04A7, 0x04A7, 0x0467, 0x0406, 0x49C8, 0xFFDF, // 0x01C0 (448) pixels 44 | 0xF7FF, 0x2968, 0x3C5B, 0x7E7F, 0xD7DF, 0xE7FF, 0xEFFF, 0xEFFF, 0xFFFF, 0xF7DF, 0xFFFF, 0xFFBF, 0xD7FC, 0x652F, 0x0487, 0x04A7, // 0x01D0 (464) pixels 45 | 0x1447, 0x1447, 0x04A8, 0x0488, 0x0467, 0x0467, 0x0C68, 0x0447, 0x0489, 0x0489, 0x0468, 0x0488, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x01E0 (480) pixels 46 | 0xFFFF, 0x2127, 0x1336, 0x1B97, 0x6433, 0x74D6, 0x9539, 0x9D9A, 0xE75E, 0xFFFF, 0xFFBF, 0xFFFF, 0xAF57, 0x3388, 0x0487, 0x04A8, // 0x01F0 (496) pixels 47 | 0x1427, 0x1427, 0x04A8, 0x0488, 0x04A8, 0x0467, 0x0C68, 0x0C68, 0x0469, 0x0469, 0x0468, 0x0488, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x0200 (512) pixels 48 | 0xEFFF, 0x1147, 0x02D9, 0x033A, 0x0B1A, 0x0B1A, 0x137A, 0x349E, 0xF79D, 0xFFFE, 0xFFDF, 0xFFDF, 0x9F9A, 0x23CB, 0x0467, 0x0488, // 0x0210 (528) pixels 49 | 0x0C48, 0x0C47, 0x0487, 0x04A7, 0x04A7, 0x04A7, 0x0488, 0x0488, 0x0488, 0x0488, 0x0488, 0x04A8, 0x0428, 0x03E7, 0x3227, 0xF7FF, // 0x0220 (544) pixels 50 | 0xEFFF, 0x1167, 0x02D9, 0x02F9, 0x0B1A, 0x02FA, 0x0B39, 0x2C3D, 0xF7DD, 0xFFFE, 0xFFBE, 0xFFDF, 0xC7FF, 0x7E55, 0x0467, 0x0467, // 0x0230 (560) pixels 51 | 0x0C68, 0x0C68, 0x04A7, 0x0466, 0x04C7, 0x0486, 0x0467, 0x04A8, 0x0488, 0x0488, 0x0488, 0x04A8, 0x0428, 0x03E7, 0x3227, 0xF7FF, // 0x0240 (576) pixels 52 | 0xEFFF, 0x1948, 0x02F7, 0x02F7, 0x0338, 0x0338, 0x0337, 0x243A, 0xCE9D, 0xF7FF, 0xFFFF, 0xFFFF, 0xFFFD, 0xFFFD, 0x9674, 0x43EA, // 0x0250 (592) pixels 53 | 0x0447, 0x0488, 0x04A7, 0x04E8, 0x0446, 0x0487, 0x0CA8, 0x0467, 0x0C67, 0x0C67, 0x0487, 0x0487, 0x0468, 0x0427, 0x3A26, 0xFFFE, // 0x0260 (608) pixels 54 | 0xF7FF, 0x1948, 0x02F7, 0x0338, 0x0B99, 0x13BA, 0x1BD9, 0x2C7C, 0xA558, 0xF7DF, 0xFFFF, 0xFFFF, 0xFFFD, 0xFFFD, 0xDFFD, 0xB758, // 0x0270 (624) pixels 55 | 0x1D8C, 0x0488, 0x0487, 0x0487, 0x0CA8, 0x0467, 0x0C88, 0x0467, 0x0C67, 0x0C67, 0x0487, 0x0487, 0x0468, 0x0427, 0x3A26, 0xFFFE, // 0x0280 (640) pixels 56 | 0xEFFF, 0x1186, 0x5336, 0x743A, 0x9558, 0xB63B, 0xCF1A, 0xD75B, 0xFF9A, 0xFFDB, 0xFFFD, 0xFFFD, 0xFFFF, 0xFFDF, 0xFFFF, 0xFFFF, // 0x0290 (656) pixels 57 | 0xD79B, 0x640D, 0x0C48, 0x0C69, 0x0447, 0x0447, 0x0C68, 0x0447, 0x0467, 0x0467, 0x0487, 0x0487, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x02A0 (672) pixels 58 | 0xE7FF, 0x3ACB, 0xAE1F, 0xDF7F, 0xEFFF, 0xEFFF, 0xEFFE, 0xE7BD, 0xFF58, 0xF738, 0xF73A, 0xFF9C, 0xF7DF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x02B0 (688) pixels 59 | 0xEFFE, 0xDFBC, 0x1CEB, 0x0428, 0x0C68, 0x0447, 0x0447, 0x0C68, 0x0467, 0x0467, 0x0487, 0x0487, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x02C0 (704) pixels 60 | 0xFFFF, 0x738F, 0xF736, 0xFF98, 0xFF0D, 0xFE6B, 0xF646, 0xF625, 0xFDA3, 0xFE04, 0xEDC4, 0xFE66, 0xFF34, 0xFFB6, 0xFFDE, 0xFFFF, // 0x02D0 (720) pixels 61 | 0xFFBF, 0xFFDF, 0x9F78, 0x23A9, 0x0468, 0x04CA, 0x0448, 0x0489, 0x04A8, 0x04A8, 0x0487, 0x0487, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x02E0 (736) pixels 62 | 0xFFDF, 0x736F, 0xE6B4, 0xD653, 0xEDE8, 0xE5A7, 0xE5C4, 0xEDE4, 0xFD82, 0xF582, 0xEDC4, 0xEDE4, 0xE5AE, 0xFEB2, 0xFFFF, 0xFFFF, // 0x02F0 (752) pixels 63 | 0xFFDF, 0xFFBF, 0xC7FD, 0x552F, 0x0488, 0x0468, 0x0488, 0x0468, 0x04A8, 0x04A8, 0x0487, 0x0487, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x0300 (768) pixels 64 | 0xFFFD, 0x734A, 0xE584, 0xEDC5, 0xF5C1, 0xF5C1, 0xEDC0, 0xEDC0, 0xED82, 0xF5A2, 0xE5E1, 0xE5E1, 0xFDC1, 0xFDE2, 0xE6B2, 0xFFF7, // 0x0310 (784) pixels 65 | 0xFFFF, 0xF7FF, 0xEFFE, 0xA5D4, 0x0448, 0x0C89, 0x0468, 0x0468, 0x0487, 0x04A7, 0x0447, 0x0447, 0x0469, 0x03E7, 0x2A27, 0xEFFF, // 0x0320 (800) pixels 66 | 0xFFDD, 0x5AA8, 0xDD43, 0xDD64, 0xED80, 0xF5C1, 0xF5E0, 0xEDC0, 0xF5A2, 0xF5A3, 0xE5E1, 0xE5C1, 0xF5A1, 0xF5A1, 0xD60F, 0xF713, // 0x0330 (816) pixels 67 | 0xF7FF, 0xFFFF, 0xF7FE, 0xB656, 0x0427, 0x0448, 0x0488, 0x0468, 0x0487, 0x04C8, 0x0C88, 0x0426, 0x0468, 0x03E6, 0x21E6, 0xF7FF, // 0x0340 (832) pixels 68 | 0xF7FF, 0x00A2, 0xE501, 0xED62, 0xFD81, 0xFD81, 0xF562, 0xFDA3, 0xE5C0, 0xEDE0, 0xEDC1, 0xEDA0, 0xF5C0, 0xF5C0, 0xEDE3, 0xFE65, // 0x0350 (848) pixels 69 | 0xFFDE, 0xFFDE, 0xE7FC, 0xA634, 0x0487, 0x04A8, 0x0488, 0x0467, 0x04C7, 0x0487, 0x0466, 0x0487, 0x1408, 0x0BC7, 0x08A1, 0xFFFE, // 0x0360 (864) pixels 70 | 0xF7FF, 0x0060, 0xC420, 0xE542, 0xFD81, 0xFDA2, 0xFDA3, 0xF562, 0xEDE1, 0xEDE1, 0xF5E1, 0xEDC1, 0xF5C0, 0xF5C0, 0xEDC3, 0xFE24, // 0x0370 (880) pixels 71 | 0xFFBD, 0xFFDE, 0xEFFD, 0x8551, 0x0487, 0x04A7, 0x0488, 0x0488, 0x04A7, 0x04A7, 0x0487, 0x0487, 0x0BE7, 0x0345, 0x0040, 0xFFFE, // 0x0380 (896) pixels 72 | 0xFFDF, 0x0823, 0x3120, 0xACEC, 0xED83, 0xE542, 0xE582, 0xEDA3, 0xF564, 0xED64, 0xF561, 0xF561, 0xF561, 0xF561, 0xDDA7, 0xEE29, // 0x0390 (912) pixels 73 | 0xFF5C, 0xFFDF, 0xB7FB, 0x3C4B, 0x0448, 0x0489, 0x1429, 0x1429, 0x0C28, 0x0C69, 0x1408, 0x13E7, 0x3308, 0x0161, 0x0800, 0xFFFF, // 0x03A0 (928) pixels 74 | 0xFFDF, 0x0002, 0x1880, 0x3120, 0xC460, 0xDD22, 0xEDA3, 0xDD41, 0xED43, 0xE523, 0xED41, 0xED41, 0xED41, 0xED41, 0xDDA7, 0xEE29, // 0x03B0 (944) pixels 75 | 0xFF7D, 0xFF7D, 0x7E73, 0x23A9, 0x0428, 0x0448, 0x0BE8, 0x0BE8, 0x0428, 0x0408, 0x1407, 0x0345, 0x0100, 0x0080, 0x1020, 0xFFFF, // 0x03C0 (960) pixels 76 | 0xFFFE, 0x0020, 0x0802, 0x0802, 0x0040, 0x0080, 0x0020, 0x0840, 0x0840, 0x0820, 0x0801, 0x0801, 0x0020, 0x0020, 0x0040, 0x0060, // 0x03D0 (976) pixels 77 | 0x0000, 0x1062, 0x0040, 0x0060, 0x1820, 0x1000, 0x0020, 0x0040, 0x0040, 0x0060, 0x0060, 0x00A0, 0x0841, 0x0800, 0x0042, 0xF7FF, // 0x03E0 (992) pixels 78 | 0xFFFE, 0xFFFE, 0xFFDF, 0xFFBF, 0xF7FF, 0xF7FF, 0xFFFE, 0xFFFF, 0xFFFE, 0xFFFD, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF7FF, // 0x03F0 (1008) pixels 79 | 0xFFFF, 0xFFDF, 0xEFFF, 0xF7FF, 0xFFBE, 0xFFDF, 0xFFFF, 0xFFFF, 0xF7FF, 0xF7FE, 0xF7FF, 0xF7FE, 0xFFFF, 0xFFFF, 0xF7FF, 0xFFFF, // 0x0400 (1024) pixels 80 | }; 81 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo/heart24.h: -------------------------------------------------------------------------------- 1 | // Generated by : ImageConverter 565 Online 2 | // Generated from : heart.png 3 | // Time generated : Wed, 19 Apr 17 18:35:04 +0200 (Server timezone: CET) 4 | // Image Size : 24x24 pixels 5 | // Memory usage : 1152 bytes 6 | 7 | 8 | #if defined(__AVR__) 9 | #include 10 | #elif defined(__PIC32MX__) 11 | #define PROGMEM 12 | #elif defined(__arm__) 13 | #define PROGMEM 14 | #endif 15 | 16 | const unsigned short bitmap24[576] PROGMEM={ 17 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0010 (16) pixels 18 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0020 (32) pixels 19 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0030 (48) pixels 20 | 0x0000, 0x0000, 0x0000, 0x0000, 0x9800, 0x9800, 0xA020, 0xA020, 0xA000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9800, // 0x0040 (64) pixels 21 | 0x9800, 0x9800, 0x9820, 0x9800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9800, 0xA020, 0xB102, 0xC245, 0xC205, 0xB902, // 0x0050 (80) pixels 22 | 0xB081, 0x9020, 0x2000, 0x0000, 0x0000, 0x0000, 0x9800, 0xA8A1, 0xB9C4, 0xC1C4, 0xB8E2, 0xB081, 0xA020, 0x5800, 0x0000, 0x0000, // 0x0060 (96) pixels 23 | 0x0000, 0x0000, 0xA020, 0xB9C4, 0xECEF, 0xF5F4, 0xECEF, 0xDB08, 0xC943, 0xB8C2, 0x9820, 0x4000, 0x0000, 0xA000, 0xBA25, 0xE4AE, // 0x0070 (112) pixels 24 | 0xEDB2, 0xED0F, 0xDB28, 0xC923, 0xB8A1, 0x9820, 0x2800, 0x0000, 0x0000, 0x9800, 0xB0E2, 0xE4AE, 0xF676, 0xED51, 0xE44C, 0xDB48, // 0x0080 (128) pixels 25 | 0xD1C4, 0xD163, 0xB922, 0x9020, 0x8923, 0xD42C, 0xF5F4, 0xF676, 0xED91, 0xE48D, 0xDB69, 0xD183, 0xC8C2, 0xB881, 0x8820, 0x0000, // 0x0090 (144) pixels 26 | 0x9800, 0xA020, 0xD286, 0xED71, 0xECEF, 0xDB28, 0xD1E4, 0xD1A4, 0xD163, 0xD1E4, 0xD2C7, 0xC328, 0xD4AE, 0xF655, 0xEDD3, 0xECCE, // 0x00A0 (160) pixels 27 | 0xDB49, 0xD245, 0xD1A4, 0xC902, 0xC922, 0xC922, 0xA881, 0x7000, 0x9800, 0xA881, 0xDB28, 0xECCE, 0xDB89, 0xD183, 0xD0E2, 0xD0E2, // 0x00B0 (176) pixels 28 | 0xD122, 0xD205, 0xDB28, 0xE40B, 0xECCE, 0xECAE, 0xE40B, 0xDAE7, 0xD1A3, 0xD102, 0xD0E2, 0xD122, 0xD1C4, 0xD1C4, 0xB0C2, 0x8840, // 0x00C0 (192) pixels 29 | 0xA020, 0xB0E2, 0xDAE7, 0xE40B, 0xDAC7, 0xD143, 0xD122, 0xD122, 0xD123, 0xD1A4, 0xDA46, 0xDAE7, 0xDB48, 0xDB08, 0xDA66, 0xD1C4, // 0x00D0 (208) pixels 30 | 0xD143, 0xD122, 0xD102, 0xD163, 0xD205, 0xDA46, 0xB922, 0x8860, 0x9820, 0xB122, 0xDA66, 0xDB28, 0xDA66, 0xD163, 0xD163, 0xD163, // 0x00E0 (224) pixels 31 | 0xD163, 0xD183, 0xD1A4, 0xD9C4, 0xD9E4, 0xD9C4, 0xD1A3, 0xD163, 0xD163, 0xD163, 0xD143, 0xD1A3, 0xDA86, 0xDAC7, 0xC163, 0x9061, // 0x00F0 (240) pixels 32 | 0x7000, 0xA8E2, 0xDA25, 0xDA45, 0xD9E4, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, // 0x0100 (256) pixels 33 | 0xD983, 0xD983, 0xD983, 0xDA25, 0xE308, 0xE2E7, 0xB963, 0x9081, 0x7000, 0x9881, 0xD9E4, 0xE205, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, // 0x0110 (272) pixels 34 | 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xE225, 0xE308, 0xEB89, 0xE2A7, 0xA902, 0x90C2, // 0x0120 (288) pixels 35 | 0x0000, 0x8840, 0xB943, 0xE205, 0xE245, 0xE245, 0xE225, 0xE204, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, // 0x0130 (304) pixels 36 | 0xE205, 0xE286, 0xEB28, 0xEBCA, 0xEB69, 0xC1A4, 0xA102, 0x9922, 0x0000, 0x0000, 0xA0E2, 0xC183, 0xEA86, 0xEAA7, 0xEAA6, 0xEA66, // 0x0140 (320) pixels 37 | 0xEA45, 0xEA25, 0xEA25, 0xEA25, 0xEA25, 0xEA25, 0xEA25, 0xEA86, 0xEB08, 0xEB89, 0xEBEB, 0xEB69, 0xC9E4, 0xA963, 0xA1E4, 0x9922, // 0x0150 (336) pixels 38 | 0x0000, 0x0000, 0x9922, 0xA142, 0xB963, 0xE286, 0xF308, 0xEAE7, 0xEAA7, 0xEA86, 0xEA66, 0xEA46, 0xEA46, 0xEA66, 0xEAC7, 0xEB49, // 0x0160 (352) pixels 39 | 0xF3CA, 0xF3EB, 0xE328, 0xB9A4, 0xA9C4, 0xAA65, 0xA1C4, 0x88A1, 0x0000, 0x0000, 0x0000, 0xA1A3, 0xA1C4, 0xB163, 0xD225, 0xEB08, // 0x0170 (368) pixels 40 | 0xF308, 0xF2C7, 0xF2A7, 0xF2A6, 0xF2C7, 0xF328, 0xF3AA, 0xF40B, 0xF3CA, 0xD286, 0xB1A3, 0xB286, 0xB2C6, 0xAA24, 0x9922, 0x0000, // 0x0180 (384) pixels 41 | 0x0000, 0x0000, 0x0000, 0x0000, 0xA1A3, 0xAA65, 0xA9C4, 0xB9A4, 0xE2C7, 0xF328, 0xF308, 0xF308, 0xF349, 0xF3CA, 0xFC2C, 0xEB89, // 0x0190 (400) pixels 42 | 0xC1E4, 0xB225, 0xBB28, 0xB2C6, 0xAA24, 0x9922, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9922, 0xAA45, 0xAA45, // 0x01A0 (416) pixels 43 | 0xB183, 0xDA86, 0xFB48, 0xFB89, 0xFBEB, 0xFC2C, 0xE348, 0xB1C4, 0xBAC7, 0xBB28, 0xB286, 0xA1C4, 0x90A1, 0x0000, 0x0000, 0x0000, // 0x01B0 (432) pixels 44 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8881, 0xA1C4, 0xAA65, 0xA983, 0xDA66, 0xFB69, 0xFBCA, 0xE328, 0xB1A4, 0xBB08, // 0x01C0 (448) pixels 45 | 0xB2E7, 0xAA45, 0x9942, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01D0 (464) pixels 46 | 0x9122, 0xAA25, 0xA983, 0xE2C7, 0xEB28, 0xB1C4, 0xBB07, 0xB2C6, 0xA9E4, 0x88C1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01E0 (480) pixels 47 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xAA04, 0xA9A4, 0xB1E4, 0xBAE7, 0xB2C6, 0xA1E4, // 0x01F0 (496) pixels 48 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0200 (512) pixels 49 | 0x0000, 0x0000, 0x0000, 0xA1C4, 0xAA24, 0xB2E7, 0xA204, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0210 (528) pixels 50 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9102, 0xA1E4, 0xA1C3, 0x80A1, 0x0000, // 0x0220 (544) pixels 51 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0230 (560) pixels 52 | 0x0000, 0x0000, 0x0000, 0x0000, 0x8040, 0x7820, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels 53 | }; 54 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo/linux32.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : linux-icon2.png.jpg 3 | // Time generated : 2018-02-08 06:44:16.175415 UTC 4 | // Image Size : 32x32 pixels 5 | // Memory usage : 2048 bytes 6 | 7 | #include 8 | 9 | const unsigned short bitmap32[1024] PROGMEM={ 10 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0010 (16) pixels 11 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0020 (32) pixels 12 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x528A, 0x632C, 0x6B6D, // 0x0030 (48) pixels 13 | 0x632C, 0x4A69, 0x4208, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0040 (64) pixels 14 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4A69, 0x8C71, 0x94B2, 0x8C71, // 0x0050 (80) pixels 15 | 0x83F0, 0x738E, 0x528A, 0x39C6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0060 (96) pixels 16 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x630C, 0x8430, 0x8430, 0x8410, // 0x0070 (112) pixels 17 | 0x73CE, 0x632C, 0x5AAA, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0080 (128) pixels 18 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x632C, 0x7BEF, 0x7BEF, 0x7BCF, // 0x0090 (144) pixels 19 | 0x6B6D, 0x630C, 0x528A, 0x41E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00A0 (160) pixels 20 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x6B6D, 0xAD54, 0x738E, 0x6B4D, // 0x00B0 (176) pixels 21 | 0xB596, 0xBDD7, 0x4A69, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00C0 (192) pixels 22 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x9CF3, 0x18C3, 0x2965, 0x6B6D, // 0x00D0 (208) pixels 23 | 0xCE59, 0x18C3, 0x73AE, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00E0 (224) pixels 24 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39C7, 0x6B4D, 0x1880, 0xC508, 0xBCA7, // 0x00F0 (240) pixels 25 | 0x5A67, 0x2104, 0x632C, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0100 (256) pixels 26 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41E6, 0x734A, 0xE608, 0xFF23, 0xFE60, // 0x0110 (272) pixels 27 | 0xFD40, 0xD463, 0x6AC6, 0x39C7, 0x39A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0120 (288) pixels 28 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5245, 0xE5C3, 0xFF24, 0xFEE1, 0xFE20, // 0x0130 (304) pixels 29 | 0xFDA0, 0xF4E0, 0xAB83, 0x39C7, 0x39E7, 0x39C7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0140 (320) pixels 30 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4A25, 0x93A5, 0xFE62, 0xFE66, 0xFDA3, // 0x0150 (336) pixels 31 | 0xF4A0, 0xE465, 0x7B8C, 0x39C7, 0x4A49, 0x39E7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0160 (352) pixels 32 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39C7, 0x8410, 0xE651, 0xFDE9, 0xF565, // 0x0170 (368) pixels 33 | 0xD54C, 0xB575, 0x9D14, 0x39C7, 0x4228, 0x4A69, 0x4208, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0180 (384) pixels 34 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x4228, 0xBDF7, 0xE73C, 0xD6BA, 0xCE59, // 0x0190 (400) pixels 35 | 0xC618, 0xBDF7, 0xB5B6, 0x632C, 0x31A6, 0x52AA, 0x4208, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01A0 (416) pixels 36 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39C7, 0x4208, 0x94B2, 0xFFDF, 0xF79E, 0xEF5D, 0xE71C, // 0x01B0 (432) pixels 37 | 0xDEDB, 0xD69A, 0xCE59, 0x9CF3, 0x3186, 0x31C6, 0x4A49, 0x39C7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01C0 (448) pixels 38 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x528A, 0xE71C, 0xFFDF, 0xF7BE, 0xF79E, 0xEF5D, // 0x01D0 (464) pixels 39 | 0xE71C, 0xDEFB, 0xD69A, 0xCE58, 0x39E7, 0x3186, 0x3186, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01E0 (480) pixels 40 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x528A, 0x5ACB, 0xF79E, 0xFFDF, 0xFFDF, 0xF7BE, 0xEF7D, // 0x01F0 (496) pixels 41 | 0xE73C, 0xDEFB, 0xD69A, 0xCE59, 0x9CD3, 0x31A6, 0x31A6, 0x39A6, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0200 (512) pixels 42 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x4A69, 0x9492, 0xF79E, 0xF7BE, 0xF7BE, 0xF7BE, 0xEF7D, // 0x0210 (528) pixels 43 | 0xEF5D, 0xDEFB, 0xCE79, 0xC618, 0xD6BA, 0x4A69, 0x31A6, 0x39E7, 0x31A6, 0x3186, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0220 (544) pixels 44 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x528A, 0xEF5D, 0xF7BE, 0xF7BF, 0xF7BE, 0xF7BE, 0xEF7D, // 0x0230 (560) pixels 45 | 0xE73C, 0xDEDB, 0xC638, 0xBDD7, 0xCE59, 0x8410, 0x39C7, 0x39C7, 0x39E7, 0x3186, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels 46 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x4A28, 0x9492, 0xFFDF, 0xFFDF, 0xFFDF, 0xF7BF, 0xF79E, 0xEF7D, // 0x0250 (592) pixels 47 | 0xE71C, 0xD6BA, 0xC618, 0xB596, 0xCE58, 0xA514, 0x39E7, 0x39C7, 0x4208, 0x3186, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0260 (608) pixels 48 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x52AA, 0x39C7, 0xC618, 0xFFDF, 0xFFDF, 0xFFDF, 0xF7BE, 0xF79E, 0xEF5D, // 0x0270 (624) pixels 49 | 0xE71C, 0xD6BA, 0xBDF7, 0xB5B6, 0xD69A, 0xBDD7, 0x4228, 0x39E7, 0x4228, 0x3186, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0280 (640) pixels 50 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4A06, 0x52AA, 0x39C7, 0xDEDB, 0xFFDF, 0xFFDF, 0xF7BE, 0xF7BE, 0xEF9E, 0xEF5D, // 0x0290 (656) pixels 51 | 0xDEFB, 0xD69A, 0xBDD7, 0xBDF7, 0xE71C, 0xC638, 0x4A69, 0x4228, 0x4A49, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x02A0 (672) pixels 52 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xBBA2, 0xE501, 0xEDA0, 0xF6D5, 0xFFDF, 0xF7BE, 0xF7BE, 0xF79E, 0xEF7D, 0xE73C, // 0x02B0 (688) pixels 53 | 0xDEDB, 0xCE59, 0xBDF7, 0xCE59, 0xEE94, 0xC52F, 0x52AA, 0x5ACB, 0x4208, 0x7AC4, 0xCC41, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x02C0 (704) pixels 54 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFCA0, 0xFD60, 0xFEC0, 0xFE61, 0xDE56, 0xF7BE, 0xF79E, 0xEF7D, 0xEF5D, 0xE71C, // 0x02D0 (720) pixels 55 | 0xD6BA, 0xC658, 0xC618, 0xDEDA, 0xFE00, 0xCC81, 0x5AEB, 0x5ACB, 0x4A48, 0xD5C1, 0xFD00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x02E0 (736) pixels 56 | 0x0000, 0x0000, 0x0000, 0xFD00, 0xFD80, 0xFDA0, 0xFD60, 0xFD20, 0xFE40, 0xFEE0, 0xCCC2, 0x9492, 0xE73C, 0xEF5D, 0xE71C, 0xDEDB, // 0x02F0 (752) pixels 57 | 0xD69A, 0xCE59, 0xCE79, 0xEF3C, 0xFE60, 0xFDE0, 0x8344, 0x62E6, 0xB503, 0xFEC0, 0xFD60, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0300 (768) pixels 58 | 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFDC0, 0xFE60, 0xFE20, 0xFD80, 0xFDC0, 0xFEA0, 0xFE80, 0x6286, 0x632C, 0xE71C, 0xDEDB, 0xD6BA, // 0x0310 (784) pixels 59 | 0xCE79, 0xCE79, 0xDEFB, 0xF7BE, 0xFE41, 0xFE40, 0xFDE0, 0xFE80, 0xFF00, 0xFEA0, 0xFE40, 0xFD60, 0xFD20, 0x0000, 0x0000, 0x0000, // 0x0320 (800) pixels 60 | 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFD20, 0xFD80, 0xFE20, 0xFDE0, 0xFDC0, 0xFE40, 0xFEC0, 0xCC61, 0x39C7, 0xC618, 0xC638, 0xC638, // 0x0330 (816) pixels 61 | 0xC638, 0xDEDB, 0xF79E, 0xD699, 0xFE20, 0xFE40, 0xFDE0, 0xFE20, 0xFE60, 0xFE80, 0xFEC0, 0xFE60, 0xFD00, 0x0000, 0x0000, 0x0000, // 0x0340 (832) pixels 62 | 0x0000, 0x0000, 0x0000, 0xFD60, 0xFDC0, 0xFDA0, 0xFDC0, 0xFDE0, 0xFDE0, 0xFE40, 0xFE60, 0xFE40, 0xBCAA, 0xAD55, 0xBDD7, 0xCE59, // 0x0350 (848) pixels 63 | 0xDEFB, 0xF79E, 0xBDD7, 0x72C7, 0xFE20, 0xFE20, 0xFDC0, 0xFD80, 0xFD60, 0xFDC0, 0xFDA0, 0xFD20, 0xFCE1, 0x0000, 0x0000, 0x0000, // 0x0360 (864) pixels 64 | 0x0000, 0x0000, 0x0000, 0xFD80, 0xFE20, 0xFDC0, 0xFDE0, 0xFDC0, 0xFDC0, 0xFDE0, 0xFE20, 0xFE20, 0xFDA0, 0xA48F, 0xB575, 0xB596, // 0x0370 (880) pixels 65 | 0x94B2, 0x5ACB, 0x39C7, 0x8B24, 0xFE40, 0xFE00, 0xFD80, 0xFD20, 0xFD00, 0xFD00, 0xFCE1, 0xFCC2, 0xFCC1, 0x0000, 0x0000, 0x0000, // 0x0380 (896) pixels 66 | 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFD60, 0xFDC0, 0xFDC0, 0xFDC0, 0xFD80, 0xFD80, 0xFDA0, 0xFDA0, 0xFD80, 0x8AE3, 0x3186, 0x3186, // 0x0390 (912) pixels 67 | 0x3186, 0x3186, 0x3186, 0xA3A3, 0xFDE0, 0xFDA0, 0xFD40, 0xFD20, 0xFD60, 0xFD22, 0xFCE1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x03A0 (928) pixels 68 | 0x0000, 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFD20, 0xFD60, 0xFD60, 0xFD60, 0xFD40, 0xFD60, 0xFD60, 0xFD40, 0x9B23, 0x3985, 0x3186, // 0x03B0 (944) pixels 69 | 0x3186, 0x2986, 0x41C5, 0xC402, 0xFDC0, 0xFDA0, 0xFDA0, 0xFDC0, 0xFD40, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x03C0 (960) pixels 70 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFD20, 0xFD60, 0xFD40, 0xFD00, 0x0000, 0x0000, 0x0000, // 0x03D0 (976) pixels 71 | 0x0000, 0x0000, 0x0000, 0xFCC0, 0xFD20, 0xFDA0, 0xFDA0, 0xFD20, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x03E0 (992) pixels 72 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x03F0 (1008) pixels 73 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0400 (1024) pixels 74 | }; 75 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo/smileytongue24.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : smiley_tongue_24.jpg 3 | // Time generated : 2017-04-24 16:31:50.352856 UTC 4 | // Image Size : 24x24 pixels 5 | // Memory usage : 1152 bytes 6 | 7 | #if defined(__AVR__) 8 | #include 9 | #elif defined(__PIC32MX__) 10 | #define PROGMEM 11 | #elif defined(__arm__) 12 | #define PROGMEM 13 | #endif 14 | 15 | const unsigned short bitmap24[576] PROGMEM={ 16 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0010 (16) pixels 17 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0020 (32) pixels 18 | 0x0000, 0x0000, 0x4207, 0xFFDD, 0xCE57, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0030 (48) pixels 19 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFBB, 0xFF56, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE564, 0xFF99, // 0x0040 (64) pixels 20 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xAD33, 0xF6D1, 0xE501, // 0x0050 (80) pixels 21 | 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xFF9A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0060 (96) pixels 22 | 0x0000, 0x0000, 0x0000, 0x0000, 0xFFBB, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, // 0x0070 (112) pixels 23 | 0xE501, 0xE501, 0xFF57, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFDC, 0xE501, 0xE501, 0xDD01, 0xE501, // 0x0080 (128) pixels 24 | 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xDD01, 0xE501, 0xE501, 0xFF78, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0090 (144) pixels 25 | 0x0000, 0x0000, 0x0000, 0xE501, 0xDD01, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE502, 0xE501, 0xE501, 0xDD01, 0xDD01, 0xE501, // 0x00A0 (160) pixels 26 | 0xE501, 0xDD01, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF99, 0xE501, 0xE502, 0xE501, 0x4A69, 0x4A6A, // 0x00B0 (176) pixels 27 | 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE502, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xDD01, 0x0000, 0x0000, 0x0000, // 0x00C0 (192) pixels 28 | 0x0000, 0x0000, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0x0000, 0x94B2, 0xE501, 0xE502, 0xE501, 0xE501, 0xE501, 0xE501, // 0x00D0 (208) pixels 29 | 0xDD01, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0xFFDC, 0xE501, 0xE501, 0xE501, 0x0000, 0x4A69, 0xE502, // 0x00E0 (224) pixels 30 | 0x4A69, 0x0000, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0x4A69, 0x0000, 0x0000, 0xE501, 0xE501, 0xE501, 0xFF58, 0x0000, 0x0000, // 0x00F0 (240) pixels 31 | 0x0000, 0xFF9A, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0x94B3, 0xE501, 0xE501, 0xE501, 0xE502, 0x0000, 0x0000, // 0x0100 (256) pixels 32 | 0x4A69, 0x0000, 0x0000, 0xE501, 0xE501, 0xE5A7, 0x0000, 0x0000, 0x0000, 0xFF79, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xDD01, // 0x0110 (272) pixels 33 | 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE502, 0x94B2, 0xE501, 0xE501, 0xE501, 0x0000, 0xDD01, 0xDD01, 0xE501, 0x0000, 0x0000, // 0x0120 (288) pixels 34 | 0x0000, 0xFF79, 0xE501, 0xE501, 0xFE31, 0xFD91, 0xF5B0, 0xF5F1, 0xF5EC, 0xE501, 0xDD01, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, // 0x0130 (304) pixels 35 | 0xE501, 0xE501, 0xE501, 0xE502, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0xFF9A, 0xE501, 0xE501, 0xFE31, 0xF4D0, 0xF800, 0xF800, // 0x0140 (320) pixels 36 | 0xF800, 0xDC4D, 0xE4AE, 0xE50F, 0xED90, 0xFE52, 0xE501, 0xE501, 0xE502, 0xE501, 0xE501, 0xE501, 0xE501, 0xEDA7, 0x0000, 0x0000, // 0x0150 (336) pixels 37 | 0x0000, 0xFFDC, 0xE501, 0xE501, 0xED66, 0xE48E, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xDBAC, 0xE40D, 0xF4F0, 0xF4F0, 0xF530, // 0x0160 (352) pixels 38 | 0xFD91, 0xE501, 0xE501, 0xE501, 0xE501, 0xFF57, 0x0000, 0x0000, 0x0000, 0x0000, 0xE501, 0xE501, 0xE501, 0xF800, 0xF800, 0xF800, // 0x0170 (368) pixels 39 | 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF4F0, 0xFDB1, 0xDD01, 0xE501, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, // 0x0180 (384) pixels 40 | 0x0000, 0x0000, 0xFF78, 0xE501, 0xED70, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF550, // 0x0190 (400) pixels 41 | 0xE501, 0xE501, 0xDD01, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xE501, 0xE50E, 0xF800, 0xF800, 0xF800, // 0x01A0 (416) pixels 42 | 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF4F0, 0xF550, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, // 0x01B0 (432) pixels 43 | 0x0000, 0x0000, 0x0000, 0xFFBC, 0xED90, 0xDC0D, 0xE30A, 0xF800, 0xF800, 0xDC0C, 0xE46E, 0xF510, 0xF570, 0xFE11, 0xE501, 0xE502, // 0x01C0 (448) pixels 44 | 0xDD01, 0xE501, 0xE501, 0xFF77, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF7A, 0xE4AE, 0xE3CB, 0xE36A, // 0x01D0 (464) pixels 45 | 0xDBCC, 0xDC8E, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xFF57, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01E0 (480) pixels 46 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF9C, 0xEDD2, 0xED2F, 0xEDB0, 0xDD01, 0xE501, 0xE501, 0xDD01, 0xE501, 0xE521, 0xE501, // 0x01F0 (496) pixels 47 | 0xE501, 0xFF99, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFBB, // 0x0200 (512) pixels 48 | 0xFF55, 0xE501, 0xE501, 0xE501, 0xE501, 0xE502, 0xE501, 0xFF79, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0210 (528) pixels 49 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xEF5B, 0xE501, 0xE501, 0x2103, 0x0000, 0x0000, // 0x0220 (544) pixels 50 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0230 (560) pixels 51 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels 52 | }; 53 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo/yellowsmiley24.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : yellowsmiley24.jpg 3 | // Time generated : 2017-04-23 04:26:54.705142 UTC 4 | // Image Size : 24x24 pixels 5 | // Memory usage : 1152 bytes 6 | 7 | #if defined(__AVR__) 8 | #include 9 | #elif defined(__PIC32MX__) 10 | #define PROGMEM 11 | #elif defined(__arm__) 12 | #define PROGMEM 13 | #endif 14 | 15 | const unsigned short bitmap24[576] PROGMEM={ 16 | 0x0801, 0x0800, 0x0800, 0x0000, 0x0000, 0x0040, 0x1880, 0x6122, 0x82A1, 0xA3C4, 0xBC65, 0xC4A5, 0xCCA6, 0xBC45, 0xA383, 0x8280, // 0x0010 (16) pixels 17 | 0x5101, 0x1040, 0x0060, 0x0000, 0x0801, 0x0800, 0x0000, 0x0000, 0x0000, 0x0040, 0x0020, 0x0001, 0x1840, 0x61E0, 0xABC2, 0xD5CA, // 0x0020 (32) pixels 18 | 0xF711, 0xFFB4, 0xFFF8, 0xFFF9, 0xFFF9, 0xFFF8, 0xFF74, 0xF6F1, 0xCD68, 0xA382, 0x5160, 0x1881, 0x0001, 0x0020, 0x0040, 0x0001, // 0x0030 (48) pixels 19 | 0x0000, 0x0020, 0x0020, 0x2880, 0x8AA2, 0xD527, 0xFF51, 0xFFB7, 0xFFD7, 0xFFB5, 0xFFB5, 0xFF93, 0xFF73, 0xFF74, 0xFF95, 0xFF96, // 0x0040 (64) pixels 20 | 0xFF57, 0xFED0, 0xCC86, 0x7AA1, 0x18A0, 0x0000, 0x0020, 0x0020, 0x0800, 0x0803, 0x28C0, 0x9340, 0xE549, 0xFF56, 0xFFF7, 0xFF92, // 0x0050 (80) pixels 21 | 0xFF92, 0xFF71, 0xFF50, 0xFF70, 0xFF70, 0xFF30, 0xFF51, 0xFF31, 0xFF53, 0xFF97, 0xFF15, 0xD4C6, 0x82E0, 0x2861, 0x0802, 0x0000, // 0x0060 (96) pixels 22 | 0x0021, 0x2060, 0x8280, 0xDD69, 0xFF75, 0xFF52, 0xFF8F, 0xFF70, 0xFF50, 0xFF50, 0xFF91, 0xF750, 0xFF90, 0xFF70, 0xFF10, 0xFEF0, // 0x0070 (112) pixels 23 | 0xFECE, 0xFF30, 0xF712, 0xFED3, 0xD4C7, 0x7AA0, 0x1860, 0x0802, 0x0020, 0x61E0, 0xC465, 0xFF10, 0xFFB1, 0xFF4F, 0xFF0F, 0xFF51, // 0x0080 (128) pixels 24 | 0xFF4E, 0xFF30, 0xFF11, 0xE5CD, 0xF66F, 0xFF30, 0xFEEF, 0xFF0F, 0xFED0, 0xFEAF, 0xFEED, 0xFEF0, 0xFE70, 0xB3E3, 0x5A00, 0x0820, // 0x0090 (144) pixels 25 | 0x3081, 0xA381, 0xFE6C, 0xFF13, 0xFF10, 0xFEEE, 0xFF2F, 0xFF4E, 0xFF2E, 0xFF0F, 0xDE0D, 0xBCC9, 0xE62D, 0xFEEF, 0xFEEE, 0xFEEE, // 0x00A0 (160) pixels 26 | 0xFEEE, 0xF6AF, 0xFE6C, 0xFE6E, 0xFE94, 0xEDAB, 0x9B40, 0x2060, 0x7220, 0xBCA6, 0xFECD, 0xFEEF, 0xFECD, 0xFF2E, 0xFEEE, 0xFEEE, // 0x00B0 (176) pixels 27 | 0xFEED, 0xFEAE, 0xC4A8, 0xBC88, 0xFEAF, 0xFECE, 0xFECE, 0xFE8D, 0xFE6D, 0xFE6E, 0xFE8E, 0xFE6C, 0xFE2D, 0xFE8E, 0xAC44, 0x71A1, // 0x00C0 (192) pixels 28 | 0x8B01, 0xED49, 0xFE8C, 0xFEEC, 0xFECD, 0xFEAD, 0xFECD, 0xFECD, 0xFEED, 0xEE0C, 0xB3E6, 0xDD6A, 0xFE8B, 0xFE8B, 0xFEAC, 0xFE4C, // 0x00D0 (208) pixels 29 | 0xCCEA, 0xEDAB, 0xFE6B, 0xFE2B, 0xFE0D, 0xFE0D, 0xD4A7, 0x8AE0, 0x9341, 0xF5AA, 0xFEAD, 0xFE8B, 0xFE8B, 0xFE6B, 0xFE4A, 0xFE68, // 0x00E0 (224) pixels 30 | 0xFE47, 0xCCC2, 0xB3A0, 0xFDE7, 0xFDE5, 0xFE05, 0xF5E6, 0xCC84, 0xA363, 0xED89, 0xFE09, 0xFE0A, 0xFDEB, 0xFDCB, 0xE549, 0x9320, // 0x00F0 (240) pixels 31 | 0x9BA1, 0xFDA9, 0xFE4B, 0xFE4A, 0xFE48, 0xF5A7, 0xD482, 0xFE24, 0xFDE5, 0xFDE5, 0xFDE4, 0xFDE5, 0xFDC4, 0xFDE4, 0xF585, 0xA2C0, // 0x0100 (256) pixels 32 | 0xAB20, 0xFD67, 0xFD86, 0xFDA7, 0xFDC9, 0xFDA9, 0xED89, 0x9340, 0x9360, 0xFDC8, 0xFE0A, 0xFDE8, 0xFDE5, 0xFDC7, 0xBB80, 0xFDE4, // 0x0110 (272) pixels 33 | 0xFDC6, 0xFDE6, 0xFD84, 0xFDC5, 0xFDE6, 0xFDA5, 0xD463, 0xA2E1, 0xD442, 0xFD45, 0xFD44, 0xFD45, 0xFD46, 0xFD67, 0xED27, 0x9B40, // 0x0120 (288) pixels 34 | 0x9B61, 0xFD67, 0xFDA7, 0xFDA5, 0xFDA3, 0xFDE7, 0xCC02, 0xF584, 0xFDC5, 0xFDA6, 0xFDA5, 0xFDA4, 0xFDA4, 0xFD85, 0xE4C4, 0xC3C0, // 0x0130 (304) pixels 35 | 0xFD45, 0xFD23, 0xFD23, 0xFD24, 0xFCC4, 0xFD05, 0xECC5, 0xA361, 0x9B62, 0xECC4, 0xFD44, 0xFD84, 0xFD83, 0xF564, 0xE4C5, 0xCC42, // 0x0140 (320) pixels 36 | 0xFD63, 0xFD64, 0xFD85, 0xFD63, 0xFD84, 0xFD24, 0xFD65, 0xFD43, 0xFD44, 0xFD23, 0xFD03, 0xFD04, 0xFCA3, 0xFCA3, 0xE484, 0x9B21, // 0x0150 (336) pixels 37 | 0x9341, 0xE463, 0xFD64, 0xFD44, 0xFD44, 0xFD64, 0xFD66, 0xCBE2, 0xECE4, 0xFD86, 0xFD24, 0xFD44, 0xFD23, 0xFD45, 0xFD04, 0xFD24, // 0x0160 (352) pixels 38 | 0xFD04, 0xFCE3, 0xFCC3, 0xFCC4, 0xFCA3, 0xFC82, 0xD423, 0x8AE0, 0x8B40, 0xCBC0, 0xF502, 0xFD04, 0xFD25, 0xFD43, 0xFD44, 0xF506, // 0x0170 (368) pixels 39 | 0xBB80, 0xDC82, 0xF523, 0xFD44, 0xFD25, 0xFD04, 0xFD04, 0xFCE4, 0xF483, 0xFCA3, 0xFCA4, 0xFC83, 0xFC82, 0xF462, 0xBBA1, 0x8B00, // 0x0180 (384) pixels 40 | 0x72E0, 0xB341, 0xECA3, 0xFCE3, 0xFCC4, 0xFD03, 0xFD04, 0xFD44, 0xF527, 0xDC64, 0xCC02, 0xCC22, 0xCC22, 0xD402, 0xD422, 0xDC23, // 0x0190 (400) pixels 41 | 0xD402, 0xEC42, 0xFC42, 0xFC64, 0xEC82, 0xDC42, 0xA322, 0x7AC0, 0x61A1, 0x8320, 0xD402, 0xFC82, 0xFD05, 0xFCE4, 0xFCE1, 0xFCE3, // 0x01A0 (416) pixels 42 | 0xFD05, 0xFCE5, 0xF4E6, 0xFCE7, 0xFCC6, 0xFCC5, 0xF4A4, 0xF483, 0xFC83, 0xFC83, 0xFCA4, 0xF442, 0xFC23, 0xD3E2, 0x8300, 0x4900, // 0x01B0 (432) pixels 43 | 0x1840, 0x82E2, 0x9B20, 0xDC03, 0xFC82, 0xF4C3, 0xFCA3, 0xFC83, 0xFCA2, 0xFCA3, 0xFCC3, 0xFCA2, 0xFC82, 0xFC82, 0xFC82, 0xFC62, // 0x01C0 (448) pixels 44 | 0xFC43, 0xFC63, 0xEC42, 0xFC42, 0xD3C1, 0x8B20, 0x7AA2, 0x1840, 0x0020, 0x4980, 0x9320, 0xA361, 0xDC23, 0xFCA2, 0xFCA4, 0xFC85, // 0x01D0 (464) pixels 45 | 0xFC84, 0xFC83, 0xFC83, 0xFC82, 0xFC62, 0xFC63, 0xFC63, 0xFC44, 0xFC24, 0xFC62, 0xFC21, 0xDBC3, 0x9B60, 0x8300, 0x4181, 0x0800, // 0x01E0 (480) pixels 46 | 0x0000, 0x1041, 0x6A61, 0x8B00, 0xA360, 0xD3E3, 0xF463, 0xF482, 0xFC82, 0xFC62, 0xFC43, 0xFC43, 0xFC23, 0xFC43, 0xFC22, 0xFC22, // 0x01F0 (496) pixels 47 | 0xFC82, 0xEC03, 0xCB81, 0xA380, 0x9340, 0x6A00, 0x0020, 0x0000, 0x0000, 0x0000, 0x0800, 0x6A62, 0x8B00, 0x9B41, 0xBB81, 0xDC41, // 0x0200 (512) pixels 48 | 0xEC62, 0xFCA3, 0xFCC3, 0xFC82, 0xFC62, 0xFC83, 0xFC83, 0xEC62, 0xD400, 0xC381, 0x9341, 0x8B00, 0x6201, 0x0821, 0x0000, 0x0020, // 0x0210 (528) pixels 49 | 0x0001, 0x0020, 0x0001, 0x0821, 0x59C0, 0x8B01, 0x8B40, 0xAB00, 0xB341, 0xBBA2, 0xCBE2, 0xCC01, 0xCBE1, 0xCBC1, 0xBBA2, 0xB341, // 0x0220 (544) pixels 50 | 0xA321, 0x8B40, 0x82E1, 0x5180, 0x0840, 0x0001, 0x0020, 0x0001, 0x0000, 0x0002, 0x0000, 0x0020, 0x0800, 0x3080, 0x7201, 0x8340, // 0x0230 (560) pixels 51 | 0x8B40, 0x8B20, 0x9320, 0x9B40, 0x9B40, 0x9340, 0x8B40, 0x8B20, 0x8300, 0x6A22, 0x2880, 0x0020, 0x0000, 0x0800, 0x0001, 0x0000, // 0x0240 (576) pixels 52 | }; 53 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo64/MatrixGFXDemo64.ino: -------------------------------------------------------------------------------- 1 | // FastLED_NeoMatrix example for single NeoPixel Shield. 2 | // By Marc MERLIN 3 | // Contains code (c) Adafruit, license BSD 4 | 5 | //#define P32BY8X4 6 | #define DISABLE_WHITE 7 | #define P64BY64 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | // Choose your prefered pixmap 14 | //#include "heart24.h" 15 | //#include "yellowsmiley24.h" 16 | //#include "bluesmiley24.h" 17 | #include "smileytongue24.h" 18 | #ifndef PSTR 19 | #define PSTR // Make Arduino Due happy 20 | #endif 21 | 22 | 23 | // Allow temporaly dithering, does not work with ESP32 right now 24 | #ifndef ESP32 25 | #define delay FastLED.delay 26 | #endif 27 | 28 | #if defined(ESP32) or defined(ESP8266) 29 | #define PIN 5 30 | #else 31 | #define PIN 13 32 | #endif 33 | 34 | 35 | #define P16BY16X4 36 | //#define P32BY8X3 37 | #if defined(P32BY8X4) || defined(P16BY16X4) || defined(P32BY8X3) 38 | #define BM32 39 | #endif 40 | 41 | #ifdef BM32 42 | #include "google32.h" 43 | // Anything with black does not look so good with the naked eye (better on pictures) 44 | //#include "linux32.h" 45 | #endif 46 | 47 | // Max is 255, 32 is a conservative value to not overload 48 | // a USB power supply (500mA) for 12x12 pixels. 49 | #define BRIGHTNESS 64 50 | 51 | // https://learn.adafruit.com/adafruit-neopixel-uberguide/neomatrix-library 52 | // MATRIX DECLARATION: 53 | // Parameter 1 = width of EACH NEOPIXEL MATRIX (not total display) 54 | // Parameter 2 = height of each matrix 55 | // Parameter 3 = number of matrices arranged horizontally 56 | // Parameter 4 = number of matrices arranged vertically 57 | // Parameter 5 = pin number (most are valid) 58 | // Parameter 6 = matrix layout flags, add together as needed: 59 | // NEO_MATRIX_TOP, NEO_MATRIX_BOTTOM, NEO_MATRIX_LEFT, NEO_MATRIX_RIGHT: 60 | // Position of the FIRST LED in the FIRST MATRIX; pick two, e.g. 61 | // NEO_MATRIX_TOP + NEO_MATRIX_LEFT for the top-left corner. 62 | // NEO_MATRIX_ROWS, NEO_MATRIX_COLUMNS: LEDs WITHIN EACH MATRIX are 63 | // arranged in horizontal rows or in vertical columns, respectively; 64 | // pick one or the other. 65 | // NEO_MATRIX_PROGRESSIVE, NEO_MATRIX_ZIGZAG: all rows/columns WITHIN 66 | // EACH MATRIX proceed in the same order, or alternate lines reverse 67 | // direction; pick one. 68 | // NEO_TILE_TOP, NEO_TILE_BOTTOM, NEO_TILE_LEFT, NEO_TILE_RIGHT: 69 | // Position of the FIRST MATRIX (tile) in the OVERALL DISPLAY; pick 70 | // two, e.g. NEO_TILE_TOP + NEO_TILE_LEFT for the top-left corner. 71 | // NEO_TILE_ROWS, NEO_TILE_COLUMNS: the matrices in the OVERALL DISPLAY 72 | // are arranged in horizontal rows or in vertical columns, respectively; 73 | // pick one or the other. 74 | // NEO_TILE_PROGRESSIVE, NEO_TILE_ZIGZAG: the ROWS/COLUMS OF MATRICES 75 | // (tiles) in the OVERALL DISPLAY proceed in the same order for every 76 | // line, or alternate lines reverse direction; pick one. When using 77 | // zig-zag order, the orientation of the matrices in alternate rows 78 | // will be rotated 180 degrees (this is normal -- simplifies wiring). 79 | // See example below for these values in action. 80 | 81 | #ifdef P64BY64 82 | #define NUM_STRIPS 16 83 | #define NUM_LEDS_PER_STRIP 256 84 | // Define full matrix width and height. 85 | #define mw 64 86 | #define mh 64 87 | #define NUMMATRIX (mw*mh) 88 | CRGB leds[NUMMATRIX]; 89 | // Define matrix width and height. 90 | //FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, mw, mh, 91 | // NEO_MATRIX_TOP + NEO_MATRIX_LEFT + 92 | // NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG); 93 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, mw, mh, 94 | NEO_MATRIX_BOTTOM + NEO_MATRIX_LEFT + 95 | NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG); 96 | 97 | #elif defined(P32BY8X4) 98 | // Define full matrix width and height. 99 | #define mw 32 100 | #define mh 32 101 | #define NUMMATRIX (mw*mh) 102 | CRGB leds[NUMMATRIX]; 103 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, 8, 32, 4, 1, 104 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 105 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG + 106 | // progressive vs zigzag makes no difference for a 4 arrays next to one another 107 | NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_PROGRESSIVE); 108 | 109 | #elif defined(P16BY16X4) 110 | #define mw 32 111 | #define mh 32 112 | #define NUMMATRIX (mw*mh) 113 | CRGB leds[NUMMATRIX]; 114 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, 16, 16, 2, 2, 115 | NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT + 116 | NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG + 117 | NEO_TILE_TOP + NEO_TILE_RIGHT + NEO_TILE_PROGRESSIVE); 118 | 119 | #elif defined(P32BY8X3) 120 | #define mw 24 121 | #define mh 32 122 | #define NUMMATRIX (mw*mh) 123 | CRGB leds[NUMMATRIX]; 124 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, 8, 32, 3, 1, 125 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 126 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG + 127 | NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_PROGRESSIVE); 128 | 129 | #else 130 | #define mw 16 131 | #define mh 16 132 | #define NUMMATRIX (mw*mh) 133 | CRGB leds[NUMMATRIX]; 134 | // Define matrix width and height. 135 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, mw, mh, 136 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 137 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG); 138 | #endif 139 | 140 | void matrix_show() { 141 | matrix->show(); 142 | } 143 | 144 | 145 | // This could also be defined as matrix->color(255,0,0) but those defines 146 | // are meant to work for adafruit_gfx backends that are lacking color() 147 | #define LED_BLACK 0 148 | 149 | #define LED_RED_VERYLOW (3 << 11) 150 | #define LED_RED_LOW (7 << 11) 151 | #define LED_RED_MEDIUM (15 << 11) 152 | #define LED_RED_HIGH (31 << 11) 153 | 154 | #define LED_GREEN_VERYLOW (1 << 5) 155 | #define LED_GREEN_LOW (15 << 5) 156 | #define LED_GREEN_MEDIUM (31 << 5) 157 | #define LED_GREEN_HIGH (63 << 5) 158 | 159 | #define LED_BLUE_VERYLOW 3 160 | #define LED_BLUE_LOW 7 161 | #define LED_BLUE_MEDIUM 15 162 | #define LED_BLUE_HIGH 31 163 | 164 | #define LED_ORANGE_VERYLOW (LED_RED_VERYLOW + LED_GREEN_VERYLOW) 165 | #define LED_ORANGE_LOW (LED_RED_LOW + LED_GREEN_LOW) 166 | #define LED_ORANGE_MEDIUM (LED_RED_MEDIUM + LED_GREEN_MEDIUM) 167 | #define LED_ORANGE_HIGH (LED_RED_HIGH + LED_GREEN_HIGH) 168 | 169 | #define LED_PURPLE_VERYLOW (LED_RED_VERYLOW + LED_BLUE_VERYLOW) 170 | #define LED_PURPLE_LOW (LED_RED_LOW + LED_BLUE_LOW) 171 | #define LED_PURPLE_MEDIUM (LED_RED_MEDIUM + LED_BLUE_MEDIUM) 172 | #define LED_PURPLE_HIGH (LED_RED_HIGH + LED_BLUE_HIGH) 173 | 174 | #define LED_CYAN_VERYLOW (LED_GREEN_VERYLOW + LED_BLUE_VERYLOW) 175 | #define LED_CYAN_LOW (LED_GREEN_LOW + LED_BLUE_LOW) 176 | #define LED_CYAN_MEDIUM (LED_GREEN_MEDIUM + LED_BLUE_MEDIUM) 177 | #define LED_CYAN_HIGH (LED_GREEN_HIGH + LED_BLUE_HIGH) 178 | 179 | #define LED_WHITE_VERYLOW (LED_RED_VERYLOW + LED_GREEN_VERYLOW + LED_BLUE_VERYLOW) 180 | #define LED_WHITE_LOW (LED_RED_LOW + LED_GREEN_LOW + LED_BLUE_LOW) 181 | #define LED_WHITE_MEDIUM (LED_RED_MEDIUM + LED_GREEN_MEDIUM + LED_BLUE_MEDIUM) 182 | #define LED_WHITE_HIGH (LED_RED_HIGH + LED_GREEN_HIGH + LED_BLUE_HIGH) 183 | 184 | static const uint8_t PROGMEM 185 | mono_bmp[][8] = 186 | { 187 | { // 0: checkered 1 188 | B10101010, 189 | B01010101, 190 | B10101010, 191 | B01010101, 192 | B10101010, 193 | B01010101, 194 | B10101010, 195 | B01010101, 196 | }, 197 | 198 | { // 1: checkered 2 199 | B01010101, 200 | B10101010, 201 | B01010101, 202 | B10101010, 203 | B01010101, 204 | B10101010, 205 | B01010101, 206 | B10101010, 207 | }, 208 | 209 | { // 2: smiley 210 | B00111100, 211 | B01000010, 212 | B10100101, 213 | B10000001, 214 | B10100101, 215 | B10011001, 216 | B01000010, 217 | B00111100 }, 218 | 219 | { // 3: neutral 220 | B00111100, 221 | B01000010, 222 | B10100101, 223 | B10000001, 224 | B10111101, 225 | B10000001, 226 | B01000010, 227 | B00111100 }, 228 | 229 | { // 4; frowny 230 | B00111100, 231 | B01000010, 232 | B10100101, 233 | B10000001, 234 | B10011001, 235 | B10100101, 236 | B01000010, 237 | B00111100 }, 238 | }; 239 | 240 | static const uint16_t PROGMEM 241 | // These bitmaps were written for a backend that only supported 242 | // 4 bits per color with Blue/Green/Red ordering while neomatrix 243 | // uses native 565 color mapping as RGB. 244 | // I'm leaving the arrays as is because it's easier to read 245 | // which color is what when separated on a 4bit boundary 246 | // The demo code will modify the arrays at runtime to be compatible 247 | // with the neomatrix color ordering and bit depth. 248 | RGB_bmp[][64] = { 249 | // 00: blue, blue/red, red, red/green, green, green/blue, blue, white 250 | { 0x100, 0x200, 0x300, 0x400, 0x600, 0x800, 0xA00, 0xF00, 251 | 0x101, 0x202, 0x303, 0x404, 0x606, 0x808, 0xA0A, 0xF0F, 252 | 0x001, 0x002, 0x003, 0x004, 0x006, 0x008, 0x00A, 0x00F, 253 | 0x011, 0x022, 0x033, 0x044, 0x066, 0x088, 0x0AA, 0x0FF, 254 | 0x010, 0x020, 0x030, 0x040, 0x060, 0x080, 0x0A0, 0x0F0, 255 | 0x110, 0x220, 0x330, 0x440, 0x660, 0x880, 0xAA0, 0xFF0, 256 | 0x100, 0x200, 0x300, 0x400, 0x600, 0x800, 0xA00, 0xF00, 257 | 0x111, 0x222, 0x333, 0x444, 0x666, 0x888, 0xAAA, 0xFFF, }, 258 | 259 | // 01: grey to white 260 | { 0x111, 0x222, 0x333, 0x555, 0x777, 0x999, 0xAAA, 0xFFF, 261 | 0x222, 0x222, 0x333, 0x555, 0x777, 0x999, 0xAAA, 0xFFF, 262 | 0x333, 0x333, 0x333, 0x555, 0x777, 0x999, 0xAAA, 0xFFF, 263 | 0x555, 0x555, 0x555, 0x555, 0x777, 0x999, 0xAAA, 0xFFF, 264 | 0x777, 0x777, 0x777, 0x777, 0x777, 0x999, 0xAAA, 0xFFF, 265 | 0x999, 0x999, 0x999, 0x999, 0x999, 0x999, 0xAAA, 0xFFF, 266 | 0xAAA, 0xAAA, 0xAAA, 0xAAA, 0xAAA, 0xAAA, 0xAAA, 0xFFF, 267 | 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, }, 268 | 269 | // 02: low red to high red 270 | { 0x001, 0x002, 0x003, 0x005, 0x007, 0x009, 0x00A, 0x00F, 271 | 0x002, 0x002, 0x003, 0x005, 0x007, 0x009, 0x00A, 0x00F, 272 | 0x003, 0x003, 0x003, 0x005, 0x007, 0x009, 0x00A, 0x00F, 273 | 0x005, 0x005, 0x005, 0x005, 0x007, 0x009, 0x00A, 0x00F, 274 | 0x007, 0x007, 0x007, 0x007, 0x007, 0x009, 0x00A, 0x00F, 275 | 0x009, 0x009, 0x009, 0x009, 0x009, 0x009, 0x00A, 0x00F, 276 | 0x00A, 0x00A, 0x00A, 0x00A, 0x00A, 0x00A, 0x00A, 0x00F, 277 | 0x00F, 0x00F, 0x00F, 0x00F, 0x00F, 0x00F, 0x00F, 0x00F, }, 278 | 279 | // 03: low green to high green 280 | { 0x010, 0x020, 0x030, 0x050, 0x070, 0x090, 0x0A0, 0x0F0, 281 | 0x020, 0x020, 0x030, 0x050, 0x070, 0x090, 0x0A0, 0x0F0, 282 | 0x030, 0x030, 0x030, 0x050, 0x070, 0x090, 0x0A0, 0x0F0, 283 | 0x050, 0x050, 0x050, 0x050, 0x070, 0x090, 0x0A0, 0x0F0, 284 | 0x070, 0x070, 0x070, 0x070, 0x070, 0x090, 0x0A0, 0x0F0, 285 | 0x090, 0x090, 0x090, 0x090, 0x090, 0x090, 0x0A0, 0x0F0, 286 | 0x0A0, 0x0A0, 0x0A0, 0x0A0, 0x0A0, 0x0A0, 0x0A0, 0x0F0, 287 | 0x0F0, 0x0F0, 0x0F0, 0x0F0, 0x0F0, 0x0F0, 0x0F0, 0x0F0, }, 288 | 289 | // 04: low blue to high blue 290 | { 0x100, 0x200, 0x300, 0x500, 0x700, 0x900, 0xA00, 0xF00, 291 | 0x200, 0x200, 0x300, 0x500, 0x700, 0x900, 0xA00, 0xF00, 292 | 0x300, 0x300, 0x300, 0x500, 0x700, 0x900, 0xA00, 0xF00, 293 | 0x500, 0x500, 0x500, 0x500, 0x700, 0x900, 0xA00, 0xF00, 294 | 0x700, 0x700, 0x700, 0x700, 0x700, 0x900, 0xA00, 0xF00, 295 | 0x900, 0x900, 0x900, 0x900, 0x900, 0x900, 0xA00, 0xF00, 296 | 0xA00, 0xA00, 0xA00, 0xA00, 0xA00, 0xA00, 0xA00, 0xF00, 297 | 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, }, 298 | 299 | // 05: 1 black, 2R, 2O, 2G, 1B with 4 blue lines rising right 300 | { 0x000, 0x200, 0x000, 0x400, 0x000, 0x800, 0x000, 0xF00, 301 | 0x000, 0x201, 0x002, 0x403, 0x004, 0x805, 0x006, 0xF07, 302 | 0x008, 0x209, 0x00A, 0x40B, 0x00C, 0x80D, 0x00E, 0xF0F, 303 | 0x000, 0x211, 0x022, 0x433, 0x044, 0x855, 0x066, 0xF77, 304 | 0x088, 0x299, 0x0AA, 0x4BB, 0x0CC, 0x8DD, 0x0EE, 0xFFF, 305 | 0x000, 0x210, 0x020, 0x430, 0x040, 0x850, 0x060, 0xF70, 306 | 0x080, 0x290, 0x0A0, 0x4B0, 0x0C0, 0x8D0, 0x0E0, 0xFF0, 307 | 0x000, 0x200, 0x000, 0x500, 0x000, 0x800, 0x000, 0xF00, }, 308 | 309 | // 06: 4 lines of increasing red and then green 310 | { 0x000, 0x000, 0x001, 0x001, 0x002, 0x002, 0x003, 0x003, 311 | 0x004, 0x004, 0x005, 0x005, 0x006, 0x006, 0x007, 0x007, 312 | 0x008, 0x008, 0x009, 0x009, 0x00A, 0x00A, 0x00B, 0x00B, 313 | 0x00C, 0x00C, 0x00D, 0x00D, 0x00E, 0x00E, 0x00F, 0x00F, 314 | 0x000, 0x000, 0x010, 0x010, 0x020, 0x020, 0x030, 0x030, 315 | 0x040, 0x040, 0x050, 0x050, 0x060, 0x060, 0x070, 0x070, 316 | 0x080, 0x080, 0x090, 0x090, 0x0A0, 0x0A0, 0x0B0, 0x0B0, 317 | 0x0C0, 0x0C0, 0x0D0, 0x0D0, 0x0E0, 0x0E0, 0x0F0, 0x0F0, }, 318 | 319 | // 07: 4 lines of increasing red and then blue 320 | { 0x000, 0x000, 0x001, 0x001, 0x002, 0x002, 0x003, 0x003, 321 | 0x004, 0x004, 0x005, 0x005, 0x006, 0x006, 0x007, 0x007, 322 | 0x008, 0x008, 0x009, 0x009, 0x00A, 0x00A, 0x00B, 0x00B, 323 | 0x00C, 0x00C, 0x00D, 0x00D, 0x00E, 0x00E, 0x00F, 0x00F, 324 | 0x000, 0x000, 0x100, 0x100, 0x200, 0x200, 0x300, 0x300, 325 | 0x400, 0x400, 0x500, 0x500, 0x600, 0x600, 0x700, 0x700, 326 | 0x800, 0x800, 0x900, 0x900, 0xA00, 0xA00, 0xB00, 0xB00, 327 | 0xC00, 0xC00, 0xD00, 0xD00, 0xE00, 0xE00, 0xF00, 0xF00, }, 328 | 329 | // 08: criss cross of green and red with diagonal blue. 330 | { 0xF00, 0x001, 0x003, 0x005, 0x007, 0x00A, 0x00F, 0x000, 331 | 0x020, 0xF21, 0x023, 0x025, 0x027, 0x02A, 0x02F, 0x020, 332 | 0x040, 0x041, 0xF43, 0x045, 0x047, 0x04A, 0x04F, 0x040, 333 | 0x060, 0x061, 0x063, 0xF65, 0x067, 0x06A, 0x06F, 0x060, 334 | 0x080, 0x081, 0x083, 0x085, 0xF87, 0x08A, 0x08F, 0x080, 335 | 0x0A0, 0x0A1, 0x0A3, 0x0A5, 0x0A7, 0xFAA, 0x0AF, 0x0A0, 336 | 0x0F0, 0x0F1, 0x0F3, 0x0F5, 0x0F7, 0x0FA, 0xFFF, 0x0F0, 337 | 0x000, 0x001, 0x003, 0x005, 0x007, 0x00A, 0x00F, 0xF00, }, 338 | 339 | // 09: 2 lines of green, 2 red, 2 orange, 2 green 340 | { 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 341 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 342 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 343 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 344 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 345 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 346 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, 347 | 0x0F0, 0x0F0, 0x0FF, 0x0FF, 0x00F, 0x00F, 0x0F0, 0x0F0, }, 348 | 349 | // 10: multicolor smiley face 350 | { 0x000, 0x000, 0x00F, 0x00F, 0x00F, 0x00F, 0x000, 0x000, 351 | 0x000, 0x00F, 0x000, 0x000, 0x000, 0x000, 0x00F, 0x000, 352 | 0x00F, 0x000, 0xF00, 0x000, 0x000, 0xF00, 0x000, 0x00F, 353 | 0x00F, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x00F, 354 | 0x00F, 0x000, 0x0F0, 0x000, 0x000, 0x0F0, 0x000, 0x00F, 355 | 0x00F, 0x000, 0x000, 0x0F4, 0x0F3, 0x000, 0x000, 0x00F, 356 | 0x000, 0x00F, 0x000, 0x000, 0x000, 0x000, 0x00F, 0x000, 357 | 0x000, 0x000, 0x00F, 0x00F, 0x00F, 0x00F, 0x000, 0x000, }, 358 | }; 359 | 360 | 361 | void matrix_clear() { 362 | // clear does not work properly with multiple matrices connected via parallel inputs 363 | memset(leds, 0, sizeof(leds)); 364 | } 365 | 366 | // Convert a BGR 4/4/4 bitmap to RGB 5/6/5 used by Adafruit_GFX 367 | void fixdrawRGBBitmap(int16_t x, int16_t y, const uint16_t *bitmap, int16_t w, int16_t h) { 368 | uint16_t RGB_bmp_fixed[w * h]; 369 | for (uint16_t pixel=0; pixel> 8; 375 | g = (color & 0x0F0) >> 4; 376 | r = color & 0x00F; 377 | //Serial.print(" "); 378 | //Serial.print(b); 379 | //Serial.print("/"); 380 | //Serial.print(g); 381 | //Serial.print("/"); 382 | //Serial.print(r); 383 | //Serial.print(" -> "); 384 | // expand from 4/4/4 bits per color to 5/6/5 385 | b = map(b, 0, 15, 0, 31); 386 | g = map(g, 0, 15, 0, 63); 387 | r = map(r, 0, 15, 0, 31); 388 | //Serial.print(r); 389 | //Serial.print("/"); 390 | //Serial.print(g); 391 | //Serial.print("/"); 392 | //Serial.print(b); 393 | RGB_bmp_fixed[pixel] = (r << 11) + (g << 5) + b; 394 | //Serial.print(" -> "); 395 | //Serial.println(RGB_bmp_fixed[pixel], HEX); 396 | } 397 | matrix->drawRGBBitmap(x, y, RGB_bmp_fixed, w, h); 398 | } 399 | 400 | // In a case of a tile of neomatrices, this test is helpful to make sure that the 401 | // pixels are all in sequence (to check your wiring order and the tile options you 402 | // gave to the constructor). 403 | void count_pixels() { 404 | matrix_clear(); 405 | for (uint16_t i=0; idrawPixel(j, i, (uint16_t) (i%3==0?LED_BLUE_HIGH:i%3==1?LED_RED_HIGH:LED_GREEN_HIGH)); 408 | // depending on the matrix size, it's too slow to display each pixel, so 409 | // make the scan init faster. This will however be too fast on a small matrix. 410 | #ifdef ESP8266 411 | if (!(j%3)) matrix_show(); 412 | yield(); // reset watchdog timer 413 | #elif ESP32 414 | if (!(j%16)) matrix_show(); 415 | #else 416 | #endif 417 | } 418 | } 419 | while (1) matrix_show(); 420 | } 421 | 422 | // Fill the screen with multiple levels of white to gauge the quality 423 | void display_four_white() { 424 | matrix_clear(); 425 | matrix->fillRect(0,0, mw,mh, LED_WHITE_HIGH); 426 | matrix->drawRect(1,1, mw-2,mh-2, LED_WHITE_MEDIUM); 427 | matrix->drawRect(2,2, mw-4,mh-4, LED_WHITE_LOW); 428 | matrix->drawRect(3,3, mw-6,mh-6, LED_WHITE_VERYLOW); 429 | matrix_show(); 430 | } 431 | 432 | void display_bitmap(uint8_t bmp_num, uint16_t color) { 433 | static uint16_t bmx,bmy; 434 | 435 | // Clear the space under the bitmap that will be drawn as 436 | // drawing a single color pixmap does not write over pixels 437 | // that are nul, and leaves the data that was underneath 438 | matrix->fillRect(bmx,bmy, bmx+8,bmy+8, LED_BLACK); 439 | matrix->drawBitmap(bmx, bmy, mono_bmp[bmp_num], 8, 8, color); 440 | bmx += 8; 441 | if (bmx >= mw) bmx = 0; 442 | if (!bmx) bmy += 8; 443 | if (bmy >= mh) bmy = 0; 444 | matrix_show(); 445 | } 446 | 447 | void display_rgbBitmap(uint8_t bmp_num) { 448 | static uint16_t bmx,bmy; 449 | 450 | fixdrawRGBBitmap(bmx, bmy, RGB_bmp[bmp_num], 8, 8); 451 | bmx += 8; 452 | if (bmx >= mw) bmx = 0; 453 | if (!bmx) bmy += 8; 454 | if (bmy >= mh) bmy = 0; 455 | matrix_show(); 456 | } 457 | 458 | void display_lines() { 459 | matrix_clear(); 460 | 461 | // 4 levels of crossing red lines. 462 | matrix->drawLine(0,mh/2-2, mw-1,2, LED_RED_VERYLOW); 463 | matrix->drawLine(0,mh/2-1, mw-1,3, LED_RED_LOW); 464 | matrix->drawLine(0,mh/2, mw-1,mh/2, LED_RED_MEDIUM); 465 | matrix->drawLine(0,mh/2+1, mw-1,mh/2+1, LED_RED_HIGH); 466 | 467 | // 4 levels of crossing green lines. 468 | matrix->drawLine(mw/2-2, 0, mw/2-2, mh-1, LED_GREEN_VERYLOW); 469 | matrix->drawLine(mw/2-1, 0, mw/2-1, mh-1, LED_GREEN_LOW); 470 | matrix->drawLine(mw/2+0, 0, mw/2+0, mh-1, LED_GREEN_MEDIUM); 471 | matrix->drawLine(mw/2+1, 0, mw/2+1, mh-1, LED_GREEN_HIGH); 472 | 473 | // Diagonal blue line. 474 | matrix->drawLine(0,0, mw-1,mh-1, LED_BLUE_HIGH); 475 | matrix->drawLine(0,mh-1, mw-1,0, LED_ORANGE_MEDIUM); 476 | matrix_show(); 477 | } 478 | 479 | void display_boxes() { 480 | matrix_clear(); 481 | matrix->drawRect(0,0, mw,mh, LED_BLUE_HIGH); 482 | matrix->drawRect(1,1, mw-2,mh-2, LED_GREEN_MEDIUM); 483 | matrix->fillRect(2,2, mw-4,mh-4, LED_RED_HIGH); 484 | matrix->fillRect(3,3, mw-6,mh-6, LED_ORANGE_MEDIUM); 485 | matrix_show(); 486 | } 487 | 488 | void display_circles() { 489 | matrix_clear(); 490 | matrix->drawCircle(mw/2,mh/2, 2, LED_RED_MEDIUM); 491 | matrix->drawCircle(mw/2-1-min(mw,mh)/8, mh/2-1-min(mw,mh)/8, min(mw,mh)/4, LED_BLUE_HIGH); 492 | matrix->drawCircle(mw/2+1+min(mw,mh)/8, mh/2+1+min(mw,mh)/8, min(mw,mh)/4-1, LED_ORANGE_MEDIUM); 493 | matrix->drawCircle(1,mh-2, 1, LED_GREEN_LOW); 494 | matrix->drawCircle(mw-2,1, 1, LED_GREEN_HIGH); 495 | if (min(mw,mh)>12) matrix->drawCircle(mw/2-1, mh/2-1, min(mh/2-1,mw/2-1), LED_CYAN_HIGH); 496 | matrix_show(); 497 | } 498 | 499 | void display_resolution() { 500 | matrix->setTextSize(1); 501 | // not wide enough; 502 | if (mw<16) return; 503 | matrix_clear(); 504 | // Font is 5x7, if display is too small 505 | // 8 can only display 1 char 506 | // 16 can almost display 3 chars 507 | // 24 can display 4 chars 508 | // 32 can display 5 chars 509 | matrix->setCursor(0, 0); 510 | matrix->setTextColor(matrix->Color(255,0,0)); 511 | if (mw>10) matrix->print(mw/10); 512 | matrix->setTextColor(matrix->Color(255,128,0)); 513 | matrix->print(mw % 10); 514 | matrix->setTextColor(matrix->Color(0,255,0)); 515 | matrix->print('x'); 516 | // not wide enough to print 5 chars, go to next line 517 | if (mw<25) { 518 | if (mh==13) matrix->setCursor(6, 7); 519 | else if (mh>=13) { 520 | matrix->setCursor(mw-11, 8); 521 | } else { 522 | // we're not tall enough either, so we wait and display 523 | // the 2nd value on top. 524 | matrix_show(); 525 | delay(2000); 526 | matrix_clear(); 527 | matrix->setCursor(mw-11, 0); 528 | } 529 | } 530 | matrix->setTextColor(matrix->Color(0,255,128)); 531 | matrix->print(mh/10); 532 | matrix->setTextColor(matrix->Color(0,128,255)); 533 | matrix->print(mh % 10); 534 | // enough room for a 2nd line 535 | if ((mw>25 && mh >14) || mh>16) { 536 | matrix->setCursor(0, mh-7); 537 | matrix->setTextColor(matrix->Color(0,255,255)); 538 | if (mw>16) matrix->print('*'); 539 | matrix->setTextColor(matrix->Color(255,0,0)); 540 | matrix->print('R'); 541 | matrix->setTextColor(matrix->Color(0,255,0)); 542 | matrix->print('G'); 543 | matrix->setTextColor(matrix->Color(0,0,255)); 544 | matrix->print("B"); 545 | matrix->setTextColor(matrix->Color(255,255,0)); 546 | // this one could be displayed off screen, but we don't care :) 547 | matrix->print("*"); 548 | 549 | // We have a big array, great, let's assume 32x32 and add something in the middle 550 | if (mh>24 && mw>25) { 551 | for (uint16_t i=0; isetTextWrap(false); // we don't wrap text so it scrolls nicely 562 | matrix->setTextSize(1); 563 | matrix->setRotation(0); 564 | for (int8_t x=7; x>=-42; x--) { 565 | yield(); 566 | matrix_clear(); 567 | matrix->setCursor(x,0); 568 | matrix->setTextColor(LED_GREEN_HIGH); 569 | matrix->print("Hello"); 570 | if (mh>11) { 571 | matrix->setCursor(-20-x,mh-7); 572 | matrix->setTextColor(LED_ORANGE_HIGH); 573 | matrix->print("World"); 574 | } 575 | matrix_show(); 576 | delay(50); 577 | } 578 | 579 | matrix->setRotation(3); 580 | matrix->setTextSize(size); 581 | matrix->setTextColor(LED_BLUE_HIGH); 582 | for (int16_t x=8*size; x>=-6*8*size; x--) { 583 | yield(); 584 | matrix_clear(); 585 | matrix->setCursor(x,mw/2-size*4); 586 | matrix->print("Rotate"); 587 | matrix_show(); 588 | // note that on a big array the refresh rate from show() will be slow enough that 589 | // the delay become irrelevant. This is already true on a 32x32 array. 590 | delay(50/size); 591 | } 592 | matrix->setRotation(0); 593 | matrix->setCursor(0,0); 594 | matrix_show(); 595 | } 596 | 597 | // Scroll within big bitmap so that all if it becomes visible or bounce a small one. 598 | // If the bitmap is bigger in one dimension and smaller in the other one, it will 599 | // be both panned and bounced in the appropriate dimensions. 600 | void display_panOrBounceBitmap (uint8_t bitmapSize) { 601 | // keep integer math, deal with values 16 times too big 602 | // start by showing upper left of big bitmap or centering if the display is big 603 | int16_t xf = max(0, (mw-bitmapSize)/2) << 4; 604 | int16_t yf = max(0, (mh-bitmapSize)/2) << 4; 605 | // scroll speed in 1/16th 606 | int16_t xfc = 6; 607 | int16_t yfc = 3; 608 | // scroll down and right by moving upper left corner off screen 609 | // more up and left (which means negative numbers) 610 | int16_t xfdir = -1; 611 | int16_t yfdir = -1; 612 | 613 | for (uint16_t i=1; i<500; i++) { 614 | bool updDir = false; 615 | 616 | // Get actual x/y by dividing by 16. 617 | int16_t x = xf >> 4; 618 | int16_t y = yf >> 4; 619 | 620 | matrix_clear(); 621 | // bounce 8x8 tri color smiley face around the screen 622 | if (bitmapSize == 8) fixdrawRGBBitmap(x, y, RGB_bmp[10], 8, 8); 623 | // pan 24x24 pixmap 624 | if (bitmapSize == 24) matrix->drawRGBBitmap(x, y, (const uint16_t *) bitmap24, bitmapSize, bitmapSize); 625 | #ifdef BM32 626 | if (bitmapSize == 32) matrix->drawRGBBitmap(x, y, (const uint16_t *) bitmap32, bitmapSize, bitmapSize); 627 | #endif 628 | matrix_show(); 629 | 630 | // Only pan if the display size is smaller than the pixmap 631 | // but not if the difference is too small or it'll look bad. 632 | if (bitmapSize-mw>2) { 633 | xf += xfc*xfdir; 634 | if (xf >= 0) { xfdir = -1; updDir = true ; }; 635 | // we don't go negative past right corner, go back positive 636 | if (xf <= ((mw-bitmapSize) << 4)) { xfdir = 1; updDir = true ; }; 637 | } 638 | if (bitmapSize-mh>2) { 639 | yf += yfc*yfdir; 640 | // we shouldn't display past left corner, reverse direction. 641 | if (yf >= 0) { yfdir = -1; updDir = true ; }; 642 | if (yf <= ((mh-bitmapSize) << 4)) { yfdir = 1; updDir = true ; }; 643 | } 644 | // only bounce a pixmap if it's smaller than the display size 645 | if (mw>bitmapSize) { 646 | xf += xfc*xfdir; 647 | // Deal with bouncing off the 'walls' 648 | if (xf >= (mw-bitmapSize) << 4) { xfdir = -1; updDir = true ; }; 649 | if (xf <= 0) { xfdir = 1; updDir = true ; }; 650 | } 651 | if (mh>bitmapSize) { 652 | yf += yfc*yfdir; 653 | if (yf >= (mh-bitmapSize) << 4) { yfdir = -1; updDir = true ; }; 654 | if (yf <= 0) { yfdir = 1; updDir = true ; }; 655 | } 656 | 657 | if (updDir) { 658 | // Add -1, 0 or 1 but bind result to 1 to 1. 659 | // Let's take 3 is a minimum speed, otherwise it's too slow. 660 | xfc = constrain(xfc + random(-1, 2), 3, 16); 661 | yfc = constrain(xfc + random(-1, 2), 3, 16); 662 | } 663 | yield(); 664 | //delay(10); 665 | } 666 | } 667 | 668 | 669 | void loop() { 670 | // clear the screen after X bitmaps have been displayed and we 671 | // loop back to the top left corner 672 | // 8x8 => 1, 16x8 => 2, 17x9 => 6 673 | static uint8_t pixmap_count = ((mw+7)/8) * ((mh+7)/8); 674 | 675 | // You can't use millis to time frame fresh rate because it uses cli() which breaks millis() 676 | // So I use my stopwatch to count 200 displays and that's good enough 677 | #if 0 678 | // 200 displays in 13 seconds = 15 frames per second for 4096 pixels 679 | for (uint8_t i=0; i<100; i++) { 680 | matrix->fillScreen(LED_BLUE_LOW); 681 | matrix_show(); 682 | matrix->fillScreen(LED_RED_LOW); 683 | matrix_show(); 684 | } 685 | #endif 686 | 687 | Serial.println("Count pixels"); 688 | count_pixels(); 689 | Serial.println("Count pixels done"); 690 | delay(300000); 691 | matrix_clear(); 692 | 693 | display_four_white(); 694 | delay(3000); 695 | 696 | Serial.print("Screen pixmap capacity: "); 697 | Serial.println(pixmap_count); 698 | 699 | // multicolor bitmap sent as many times as we can display an 8x8 pixmap 700 | for (uint8_t i=0; i<=pixmap_count; i++) 701 | { 702 | display_rgbBitmap(0); 703 | } 704 | delay(5000); 705 | 706 | Serial.println("Display Resolution"); 707 | display_resolution(); 708 | delay(3000); 709 | 710 | Serial.println("Display bitmaps"); 711 | // Cycle through red, green, blue, display 2 checkered patterns 712 | // useful to debug some screen types and alignment. 713 | uint16_t bmpcolor[] = { LED_GREEN_HIGH, LED_BLUE_HIGH, LED_RED_HIGH }; 714 | for (uint8_t i=0; i<3; i++) 715 | { 716 | display_bitmap(0, bmpcolor[i]); 717 | delay(500); 718 | display_bitmap(1, bmpcolor[i]); 719 | delay(500); 720 | } 721 | 722 | Serial.println("Display smileys"); 723 | // Display 3 smiley faces. 724 | for (uint8_t i=2; i<=4; i++) 725 | { 726 | display_bitmap(i, bmpcolor[i-2]); 727 | // If more than one pixmap displayed per screen, display more quickly. 728 | delay(mw>8?500:1500); 729 | } 730 | // If we have multiple pixmaps displayed at once, wait a bit longer on the last. 731 | delay(mw>8?1000:500); 732 | 733 | Serial.println("Display lines, boxes and circles"); 734 | display_lines(); 735 | delay(3000); 736 | 737 | //display_boxes(); 738 | //delay(3000); 739 | 740 | display_circles(); 741 | delay(3000); 742 | matrix_clear(); 743 | 744 | Serial.println("Display RGB bitmaps"); 745 | for (uint8_t i=0; i<=(sizeof(RGB_bmp)/sizeof(RGB_bmp[0])-1); i++) 746 | { 747 | display_rgbBitmap(i); 748 | delay(mw>8?500:1500); 749 | } 750 | // If we have multiple pixmaps displayed at once, wait a bit longer on the last. 751 | delay(mw>8?1000:500); 752 | 753 | Serial.println("Scrolltext"); 754 | display_scrollText(); 755 | 756 | #ifdef BM32 757 | Serial.println("bounce 32 bitmap"); 758 | display_panOrBounceBitmap(32); 759 | #endif 760 | // pan a big pixmap 761 | Serial.println("pan/bounce 24 bitmap"); 762 | display_panOrBounceBitmap(24); 763 | // bounce around a small one 764 | Serial.println("pan/bounce 8 bitmap"); 765 | display_panOrBounceBitmap(8); 766 | 767 | Serial.println("Demo loop done, starting over"); 768 | } 769 | 770 | void setup() { 771 | #if defined(P64BY64) 772 | FastLED.addLeds(leds, 0*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 773 | FastLED.addLeds(leds, 1*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 774 | FastLED.addLeds(leds, 2*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); // was 3 775 | FastLED.addLeds(leds, 3*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 776 | FastLED.addLeds(leds, 4*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 777 | FastLED.addLeds(leds, 5*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 778 | FastLED.addLeds(leds, 6*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 779 | FastLED.addLeds(leds, 7*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 780 | 781 | FastLED.addLeds(leds, 8*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 782 | FastLED.addLeds(leds, 9*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 783 | FastLED.addLeds(leds,10*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 784 | FastLED.addLeds(leds,11*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 785 | FastLED.addLeds(leds,12*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 786 | FastLED.addLeds(leds,13*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 787 | FastLED.addLeds(leds,14*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 788 | FastLED.addLeds(leds,15*NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 789 | #elif defined(P32BY8X3) 790 | // Parallel output 791 | FastLED.addLeds(leds, NUMMATRIX/3).setCorrection(TypicalLEDStrip); 792 | #else 793 | FastLED.addLeds( leds, NUMMATRIX ).setCorrection(TypicalLEDStrip); 794 | #endif 795 | 796 | // Time for serial port to work? 797 | delay(1000); 798 | Serial.begin(115200); 799 | Serial.print("Init on pin: "); 800 | Serial.println(PIN); 801 | Serial.print("Matrix Size: "); 802 | Serial.print(mw); 803 | Serial.print(" "); 804 | Serial.print(mh); 805 | Serial.print(" "); 806 | Serial.println(NUMMATRIX); 807 | matrix->begin(); 808 | matrix->setTextWrap(false); 809 | matrix->setBrightness(BRIGHTNESS); 810 | Serial.println("If the code crashes here, decrease the brightness or turn off the all white display below"); 811 | // Test full bright of all LEDs. If brightness is too high 812 | // for your current limit (i.e. USB), decrease it. 813 | #ifndef DISABLE_WHITE 814 | matrix->fillScreen(LED_WHITE_HIGH); 815 | matrix_show(); 816 | delay(5000); 817 | matrix_clear(); 818 | #endif 819 | } 820 | 821 | // vim:sts=4:sw=4 822 | 823 | /* 824 | platforms/esp/32/clockless_esp32.h 825 | * ESP32 support is provided using the RMT peripheral device -- a unit 826 | * on the chip designed specifically for generating (and receiving) 827 | * precisely-timed digital signals. Nominally for use in infrared 828 | * remote controls, we use it to generate the signals for clockless 829 | * LED strips. The main advantage of using the RMT device is that, 830 | * once programmed, it generates the signal asynchronously, allowing 831 | * the CPU to continue executing other code. It is also not vulnerable 832 | * to interrupts or other timing problems that could disrupt the signal. 833 | * 834 | * The implementation strategy is borrowed from previous work and from 835 | * the RMT support built into the ESP32 IDF. The RMT device has 8 836 | * channels, which can be programmed independently to send sequences 837 | * of high/low bits. Memory for each channel is limited, however, so 838 | * in order to send a long sequence of bits, we need to continuously 839 | * refill the buffer until all the data is sent. To do this, we fill 840 | * half the buffer and then set an interrupt to go off when that half 841 | * is sent. Then we refill that half while the second half is being 842 | * sent. This strategy effectively overlaps computation (by the CPU) 843 | * and communication (by the RMT). 844 | * 845 | * Since the RMT device only has 8 channels, we need a strategy to 846 | * allow more than 8 LED controllers. Our driver assigns controllers 847 | * to channels on the fly, queuing up controllers as necessary until a 848 | * channel is free. The main showPixels routine just fires off the 849 | * first 8 controllers; the interrupt handler starts new controllers 850 | * asynchronously as previous ones finish. So, for example, it can 851 | * send the data for 8 controllers simultaneously, but 16 controllers 852 | * would take approximately twice as much time. 853 | * 854 | * There is a #define that allows a program to control the total 855 | * number of channels that the driver is allowed to use. It defaults 856 | * to 8 -- use all the channels. Setting it to 1, for example, results 857 | * in fully serial output: 858 | * 859 | * #define FASTLED_RMT_MAX_CHANNELS 1 860 | * 861 | * OTHER RMT APPLICATIONS 862 | * 863 | * The default FastLED driver takes over control of the RMT interrupt 864 | * handler, making it hard to use the RMT device for other 865 | * (non-FastLED) purposes. You can change it's behavior to use the ESP 866 | * core driver instead, allowing other RMT applications to 867 | * co-exist. To switch to this mode, add the following directive 868 | * before you include FastLED.h: 869 | * 870 | * #define FASTLED_RMT_BUILTIN_DRIVER 871 | * 872 | * There may be a performance penalty for using this mode. We need to 873 | * compute the RMT signal for the entire LED strip ahead of time, 874 | * rather than overlapping it with communication. We also need a large 875 | * buffer to hold the signal specification. Each bit of pixel data is 876 | * represented by a 32-bit pulse specification, so it is a 32X blow-up 877 | * in memory use. 878 | * 879 | * 880 | * Based on public domain code created 19 Nov 2016 by Chris Osborn 881 | * http://insentricity.com * 882 | * 883 | */ 884 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo64/bluesmiley24.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : bluesmiley24.jpg 3 | // Time generated : 2017-04-23 04:27:05.368571 UTC 4 | // Image Size : 24x24 pixels 5 | // Memory usage : 1152 bytes 6 | 7 | #if defined(__AVR__) 8 | #include 9 | #elif defined(__PIC32MX__) 10 | #define PROGMEM 11 | #elif defined(__arm__) 12 | #define PROGMEM 13 | #endif 14 | 15 | const unsigned short bitmap24[576] PROGMEM={ 16 | 0x0000, 0x0040, 0x0020, 0x0802, 0x0802, 0x0001, 0x0041, 0x0020, 0x0002, 0x1002, 0x0801, 0x0020, 0x0800, 0x0000, 0x0040, 0x0060, // 0x0010 (16) pixels 17 | 0x0800, 0x0000, 0x0001, 0x0001, 0x0800, 0x0800, 0x0000, 0x1000, 0x0020, 0x0000, 0x0000, 0x0042, 0x0020, 0x0000, 0x0801, 0x0000, // 0x0020 (32) pixels 18 | 0x0020, 0x0800, 0x0000, 0x0000, 0x2000, 0x0000, 0x0060, 0x0000, 0x0000, 0x0021, 0x0020, 0x0000, 0x0041, 0x0001, 0x0001, 0x0001, // 0x0030 (48) pixels 19 | 0x0000, 0x0800, 0x1021, 0x0000, 0x0020, 0x0020, 0x0000, 0x0000, 0x0040, 0x0020, 0x0001, 0x0043, 0x0002, 0x0022, 0x0021, 0x1000, // 0x0040 (64) pixels 20 | 0x0801, 0x0000, 0x0000, 0x0000, 0x0021, 0x0061, 0x0000, 0x0041, 0x0801, 0x0000, 0x0000, 0x0800, 0x0000, 0x0020, 0x0000, 0x1881, // 0x0050 (80) pixels 21 | 0x18E2, 0x0189, 0x23F7, 0x1BD8, 0x03F8, 0x33D7, 0x00E9, 0x0044, 0x0001, 0x1020, 0x0000, 0x0001, 0x0000, 0x0800, 0x0000, 0x0000, // 0x0060 (96) pixels 22 | 0x0801, 0x0040, 0x0020, 0x0000, 0x0021, 0x0001, 0x0000, 0xBDB7, 0x9F5F, 0x4E3E, 0x261F, 0x0CDB, 0x047A, 0x2C7C, 0x1338, 0x02D4, // 0x0070 (112) pixels 23 | 0x0969, 0x0000, 0x0000, 0x0821, 0x0800, 0x0800, 0x0801, 0x0801, 0x0800, 0x0021, 0x0021, 0x0000, 0x0000, 0x0000, 0xCF5D, 0xA7BF, // 0x0080 (128) pixels 24 | 0x2E9E, 0x1E3E, 0x261F, 0x051B, 0x5E3F, 0x0418, 0x0337, 0x453F, 0x0233, 0x11EF, 0x0002, 0x0800, 0x0000, 0x0041, 0x0000, 0x0000, // 0x0090 (144) pixels 25 | 0x0800, 0x0001, 0x0000, 0x0800, 0x0001, 0xC6DC, 0xD7FF, 0x6F5D, 0x2EBF, 0x4E3D, 0x4D5A, 0x15BC, 0x3C7A, 0x5DFB, 0x3437, 0x02D7, // 0x00A0 (160) pixels 26 | 0x0255, 0x54FE, 0x11AD, 0x0043, 0x0001, 0x0020, 0x0000, 0x0020, 0x0800, 0x0041, 0x0020, 0x0862, 0x7D16, 0xB77F, 0xA69B, 0x969B, // 0x00B0 (176) pixels 27 | 0x53B0, 0xADB5, 0xAEDC, 0x25DD, 0x5D3C, 0xADB6, 0x836D, 0xA61C, 0x3B74, 0x12B2, 0x1B34, 0x09CC, 0x0001, 0x0000, 0x0022, 0x0001, // 0x00C0 (192) pixels 28 | 0x0800, 0x0001, 0x0020, 0x1064, 0x6DFC, 0x659A, 0xAE7B, 0xE75F, 0x18E7, 0x3206, 0x5D76, 0x159E, 0x34DC, 0x5391, 0x18E5, 0x8D58, // 0x00D0 (208) pixels 29 | 0xD7FF, 0x74FA, 0x341B, 0x0211, 0x0063, 0x0820, 0x0001, 0x0802, 0x0000, 0x0800, 0x0822, 0x3C97, 0x35BD, 0x565E, 0x763D, 0x2D18, // 0x00E0 (224) pixels 30 | 0x0D5B, 0x255A, 0x359C, 0x155B, 0x3DDF, 0x24BC, 0x1B97, 0x54D9, 0x5436, 0x7E5F, 0x0252, 0x3C3B, 0x122E, 0x0000, 0x0020, 0x0001, // 0x00F0 (240) pixels 31 | 0x0800, 0x0020, 0x0004, 0x1419, 0x24FC, 0x1457, 0x3CB9, 0x2D1A, 0x2DBC, 0x3DFD, 0x4DBD, 0x4D7B, 0x557A, 0x4D7B, 0x4CDB, 0x6CDB, // 0x0100 (256) pixels 32 | 0x3BD6, 0x2373, 0x3313, 0x0AF6, 0x0AD3, 0x0020, 0x0820, 0x0022, 0x0800, 0x0020, 0x1A6F, 0x1337, 0x3418, 0x6D5B, 0x967E, 0xBF1F, // 0x0110 (272) pixels 33 | 0xE71D, 0xEF7E, 0xE75E, 0xEFBF, 0xE77E, 0xEF9D, 0xF79E, 0xEF5E, 0xC7DF, 0xBEDF, 0x7D7A, 0x4CBB, 0x2B34, 0x0022, 0x0800, 0x0002, // 0x0120 (288) pixels 34 | 0x0000, 0x0001, 0x124F, 0x12D5, 0x4C9A, 0x9DFB, 0xD7BE, 0xE7DF, 0xFFDF, 0xFF7F, 0xFF9F, 0xEF9F, 0xEFFF, 0xEFBF, 0xF7FE, 0xEFDC, // 0x0130 (304) pixels 35 | 0xF7FE, 0xD77F, 0x7557, 0x3C17, 0x3B55, 0x0002, 0x1000, 0x0001, 0x0001, 0x1001, 0x1A4D, 0x0A74, 0x2B58, 0x6CF6, 0xE7FE, 0xEFDF, // 0x0140 (320) pixels 36 | 0xE7BE, 0xE79F, 0xE7DF, 0xE77E, 0xD79F, 0xE77E, 0xE75D, 0xEF9E, 0xEFBF, 0xD77F, 0x7434, 0x0292, 0x44DA, 0x0002, 0x0800, 0x0061, // 0x0150 (336) pixels 37 | 0x0001, 0x0000, 0x0044, 0x0A33, 0x1277, 0x3B93, 0xC6DB, 0xE6FE, 0xD6FD, 0xD77F, 0xB6FC, 0xCF1D, 0xBEFC, 0xCEBA, 0xD6FC, 0xD6DF, // 0x0160 (352) pixels 38 | 0xD79F, 0xADFA, 0x5334, 0x0B58, 0x4D7C, 0x0000, 0x0820, 0x0040, 0x0022, 0x0000, 0x0003, 0x0A11, 0x0213, 0x11EF, 0x8D16, 0xE75E, // 0x0170 (368) pixels 39 | 0xDF3F, 0xDF1F, 0xE79F, 0xEF7E, 0xDFDF, 0xE75F, 0xDF5E, 0xCF9F, 0xE73D, 0x7CB6, 0x02B3, 0x13FC, 0x8DBE, 0x0040, 0x0020, 0x0021, // 0x0180 (384) pixels 40 | 0x0043, 0x0000, 0x0801, 0x012B, 0x0234, 0x0232, 0x2A6F, 0xC6BD, 0xDFDF, 0xD75F, 0xD77F, 0xCF7F, 0xD77F, 0xDF5E, 0xD77D, 0xD7FE, // 0x0190 (400) pixels 41 | 0xCE7E, 0x2B16, 0x041C, 0x459F, 0x0025, 0x0820, 0x0040, 0x0001, 0x0000, 0x0000, 0x1000, 0x0844, 0x120F, 0x0253, 0x0253, 0x2291, // 0x01A0 (416) pixels 42 | 0xA61A, 0xD75F, 0xCF7E, 0xCFBE, 0xCF9F, 0xD75F, 0xCF5F, 0xA6DE, 0x3C99, 0x041B, 0x353F, 0x3311, 0x0020, 0x0000, 0x0001, 0x0801, // 0x01B0 (432) pixels 43 | 0x0820, 0x0000, 0x0000, 0x0800, 0x0002, 0x0A30, 0x02D7, 0x0275, 0x01B2, 0x2AB4, 0x6478, 0x6CF8, 0x6D1A, 0x5C7B, 0x33DB, 0x0338, // 0x01C0 (448) pixels 44 | 0x041C, 0x361F, 0x4C96, 0x0001, 0x0840, 0x0021, 0x0800, 0x0000, 0x0000, 0x0000, 0x0041, 0x0000, 0x1000, 0x18A5, 0x4375, 0x23DA, // 0x01D0 (464) pixels 45 | 0x035D, 0x035B, 0x035A, 0x0B7A, 0x031A, 0x033B, 0x033B, 0x24FF, 0x555F, 0x33B0, 0x08E2, 0x0821, 0x0001, 0x0820, 0x0800, 0x0020, // 0x01E0 (480) pixels 46 | 0x0021, 0x0001, 0x0801, 0x0000, 0x0000, 0x0800, 0x0042, 0x198B, 0x2418, 0x253C, 0x0CFD, 0x0C3D, 0x247F, 0x34FF, 0x5DBD, 0x43F4, // 0x01F0 (496) pixels 47 | 0x1106, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0001, 0x0800, 0x0000, 0x0000, 0x0021, 0x0000, 0x0800, 0x1000, // 0x0200 (512) pixels 48 | 0x0042, 0x01A7, 0x1AEE, 0x2B11, 0x2AF1, 0x22CF, 0x00C3, 0x0800, 0x0801, 0x0021, 0x0022, 0x0042, 0x0000, 0x0820, 0x0001, 0x0001, // 0x0210 (528) pixels 49 | 0x0800, 0x0000, 0x0040, 0x0000, 0x0000, 0x0022, 0x0821, 0x0800, 0x1800, 0x0800, 0x0000, 0x0800, 0x0821, 0x0000, 0x0000, 0x0800, // 0x0220 (544) pixels 50 | 0x0002, 0x0061, 0x0020, 0x0001, 0x0001, 0x0000, 0x0021, 0x0000, 0x0000, 0x0021, 0x0000, 0x0021, 0x0021, 0x0020, 0x0000, 0x0001, // 0x0230 (560) pixels 51 | 0x0020, 0x0820, 0x0001, 0x0000, 0x0020, 0x0000, 0x0800, 0x0821, 0x0020, 0x0800, 0x0800, 0x0000, 0x0000, 0x0041, 0x0020, 0x0020, // 0x0240 (576) pixels 52 | }; 53 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo64/google32.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : google.jpg 3 | // Time generated : 2018-02-08 06:09:41.424425 UTC 4 | // Image Size : 32x32 pixels 5 | // Memory usage : 2048 bytes 6 | 7 | #if defined(__AVR__) 8 | #include 9 | #elif defined(__PIC32MX__) 10 | #define PROGMEM 11 | #elif defined(__arm__) 12 | #define PROGMEM 13 | #endif 14 | 15 | const unsigned short bitmap32[1024] PROGMEM={ 16 | 0xFFFE, 0xFFFE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, 0xFFDF, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFF, 0xFFFF, 0xFFDF, 0xFFDF, // 0x0010 (16) pixels 17 | 0xFFFF, 0xFFFF, 0xFFDE, 0xFFDE, 0xFFFF, 0xFFFF, 0xFFDF, 0xFFFF, 0xFFFE, 0xFFDE, 0xFFFE, 0xFFFE, 0xFFFF, 0xFFFF, 0xFFBF, 0xFFDF, // 0x0020 (32) pixels 18 | 0xFFFE, 0x0840, 0x0820, 0x0841, 0x0040, 0x0020, 0x1020, 0x0800, 0x0040, 0x0060, 0x0020, 0x0840, 0x0000, 0x0040, 0x1022, 0x0821, // 0x0030 (48) pixels 19 | 0x0861, 0x0020, 0x1020, 0x0800, 0x0820, 0x0820, 0x0001, 0x0821, 0x0800, 0x1020, 0x0820, 0x1040, 0x0041, 0x0021, 0x0821, 0xFFDF, // 0x0040 (64) pixels 20 | 0xFFFF, 0x0021, 0x0042, 0x1926, 0x343A, 0x1B98, 0x02F7, 0x0318, 0x031A, 0x033A, 0x43F8, 0x8E7F, 0xF7DF, 0xEF9F, 0xEF9D, 0xEFBD, // 0x0050 (80) pixels 21 | 0xEBF0, 0x9966, 0xE801, 0xE001, 0xD821, 0xD800, 0xE001, 0xE000, 0xD820, 0xD000, 0xD001, 0xC000, 0x3020, 0x2800, 0x0861, 0xF7FF, // 0x0060 (96) pixels 22 | 0xFFFF, 0x0021, 0x10E5, 0xB5D8, 0x2BF9, 0x0B36, 0x02F7, 0x0338, 0x031A, 0x031A, 0x2315, 0x54BB, 0xE75E, 0xF7FF, 0xF7FE, 0xFFFF, // 0x0070 (112) pixels 23 | 0xFE9B, 0xCAEC, 0xE801, 0xE801, 0xD821, 0xD800, 0xE801, 0xE001, 0xD800, 0xE040, 0xD042, 0xD022, 0x5964, 0x2800, 0x0020, 0xFFFF, // 0x0080 (128) pixels 24 | 0xFFFD, 0x0880, 0xB63C, 0x9D58, 0x0BBB, 0x0339, 0x0B1B, 0x02DB, 0x02F8, 0x0B39, 0x031B, 0x139C, 0x9E1B, 0xE7FF, 0xFFFF, 0xFFDE, // 0x0090 (144) pixels 25 | 0xFFDE, 0xC5B5, 0xF863, 0xE000, 0xE001, 0xE001, 0xD821, 0xD821, 0xE020, 0xD800, 0xF000, 0xF000, 0xC801, 0xC800, 0x0040, 0xFFFE, // 0x00A0 (160) pixels 26 | 0xFFFD, 0x10C0, 0xD71F, 0xA59A, 0x0B9A, 0x0339, 0x0B3C, 0x02FB, 0x0B39, 0x0B19, 0x02FA, 0x0B7C, 0x6C95, 0xD7DF, 0xFFFF, 0xFFDE, // 0x00B0 (176) pixels 27 | 0xFFDE, 0xEEDA, 0xF8C4, 0xE801, 0xE001, 0xE001, 0xE041, 0xD821, 0xE020, 0xE000, 0xF801, 0xF801, 0xD022, 0xC801, 0x0860, 0xFFFD, // 0x00C0 (192) pixels 28 | 0xFFFF, 0x62EB, 0xCF5E, 0x9597, 0x1BB9, 0x1337, 0x02D9, 0x031A, 0x0319, 0x0319, 0x031B, 0x033B, 0x4396, 0xB71F, 0xFFFE, 0xFFFE, // 0x00D0 (208) pixels 29 | 0xFFBF, 0xFF1C, 0xF924, 0xE041, 0xF000, 0xF000, 0xE820, 0xE000, 0xF000, 0xF800, 0xE000, 0xD800, 0xD801, 0xD801, 0x4947, 0xFF9F, // 0x00E0 (224) pixels 30 | 0xFFFF, 0x738D, 0xCF7F, 0xAE7B, 0x23B9, 0x0B37, 0x02FA, 0x0B1A, 0x0339, 0x0339, 0x033C, 0x031B, 0x3B76, 0x963F, 0xFFFE, 0xFFFE, // 0x00F0 (240) pixels 31 | 0xFF9E, 0xFF3D, 0xF945, 0xD820, 0xF801, 0xF800, 0xE800, 0xE820, 0xF800, 0xF800, 0xE821, 0xE020, 0xE001, 0xD800, 0x5167, 0xFF7F, // 0x0100 (256) pixels 32 | 0xFFFF, 0x6B8F, 0xE71D, 0xE6FD, 0x4439, 0x2335, 0x033A, 0x035A, 0x0317, 0x0B58, 0x0319, 0x0319, 0x2B76, 0x7E1F, 0xF7FF, 0xFFFF, // 0x0110 (272) pixels 33 | 0xFF7E, 0xFE7A, 0xE904, 0xD021, 0xB8C2, 0xB8C2, 0xA8C0, 0xB101, 0xC881, 0xC880, 0xF001, 0xF001, 0xE000, 0xD800, 0x5166, 0xFF9E, // 0x0120 (288) pixels 34 | 0xF7BF, 0x73B0, 0xEF3E, 0xF79F, 0x655E, 0x2356, 0x037B, 0x033A, 0x0B58, 0x0316, 0x0319, 0x033A, 0x2356, 0x7E1F, 0xFFFF, 0xF7FF, // 0x0130 (304) pixels 35 | 0xFF9E, 0xCCF4, 0xE0A3, 0xD862, 0xB8C2, 0xC0E2, 0xB942, 0xB101, 0xC8A1, 0xC8A1, 0xF001, 0xF001, 0xD800, 0xD800, 0x5166, 0xFFBF, // 0x0140 (320) pixels 36 | 0xFFFE, 0x6B6C, 0xFEFC, 0xFF7E, 0xAEFF, 0x3B94, 0x039D, 0x033B, 0x0358, 0x0379, 0x033C, 0x035C, 0x3B74, 0x963E, 0xFFFF, 0xFFFF, // 0x0150 (336) pixels 37 | 0xD7FC, 0x5C6D, 0x13C6, 0x1C07, 0x1407, 0x1407, 0x04C8, 0x0487, 0x1BE7, 0x1BE7, 0x3B45, 0x3324, 0xA101, 0xA0C0, 0x4984, 0xFFDD, // 0x0160 (352) pixels 38 | 0xFFFE, 0x73AD, 0xFF1C, 0xFF9E, 0xD7FF, 0x85DD, 0x03BE, 0x039D, 0x0358, 0x0358, 0x035C, 0x035C, 0x5437, 0xBF9F, 0xFFFF, 0xFFBE, // 0x0170 (368) pixels 39 | 0x7D72, 0x3B49, 0x1C07, 0x1C07, 0x1448, 0x1448, 0x04A8, 0x04A8, 0x1C28, 0x1C28, 0x4386, 0x3B86, 0xB142, 0xA101, 0x4984, 0xFFDD, // 0x0180 (384) pixels 40 | 0xFFFF, 0x6350, 0xDFBC, 0xEFFD, 0xFFDE, 0xF77D, 0x853A, 0x4B53, 0x2375, 0x2355, 0x3B34, 0x5C18, 0xC63A, 0xFFFF, 0xCFFC, 0x6E11, // 0x0190 (400) pixels 41 | 0x04A8, 0x0467, 0x04A7, 0x0487, 0x0466, 0x0C86, 0x0486, 0x04A6, 0x0467, 0x0488, 0x04A7, 0x04C7, 0x0447, 0x03E6, 0x41A8, 0xFFDF, // 0x01A0 (416) pixels 42 | 0xFFFF, 0x422B, 0xCF19, 0xEFFD, 0xFFFF, 0xFFFF, 0xE7FF, 0xB69F, 0x6D9E, 0x655D, 0x95DF, 0xC75F, 0xFFDF, 0xFFBF, 0x5D8F, 0x23A8, // 0x01B0 (432) pixels 43 | 0x0487, 0x04A8, 0x04A7, 0x04A7, 0x0466, 0x0C86, 0x04C7, 0x04A6, 0x0488, 0x0488, 0x04A7, 0x04A7, 0x0467, 0x0406, 0x49C8, 0xFFDF, // 0x01C0 (448) pixels 44 | 0xF7FF, 0x2968, 0x3C5B, 0x7E7F, 0xD7DF, 0xE7FF, 0xEFFF, 0xEFFF, 0xFFFF, 0xF7DF, 0xFFFF, 0xFFBF, 0xD7FC, 0x652F, 0x0487, 0x04A7, // 0x01D0 (464) pixels 45 | 0x1447, 0x1447, 0x04A8, 0x0488, 0x0467, 0x0467, 0x0C68, 0x0447, 0x0489, 0x0489, 0x0468, 0x0488, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x01E0 (480) pixels 46 | 0xFFFF, 0x2127, 0x1336, 0x1B97, 0x6433, 0x74D6, 0x9539, 0x9D9A, 0xE75E, 0xFFFF, 0xFFBF, 0xFFFF, 0xAF57, 0x3388, 0x0487, 0x04A8, // 0x01F0 (496) pixels 47 | 0x1427, 0x1427, 0x04A8, 0x0488, 0x04A8, 0x0467, 0x0C68, 0x0C68, 0x0469, 0x0469, 0x0468, 0x0488, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x0200 (512) pixels 48 | 0xEFFF, 0x1147, 0x02D9, 0x033A, 0x0B1A, 0x0B1A, 0x137A, 0x349E, 0xF79D, 0xFFFE, 0xFFDF, 0xFFDF, 0x9F9A, 0x23CB, 0x0467, 0x0488, // 0x0210 (528) pixels 49 | 0x0C48, 0x0C47, 0x0487, 0x04A7, 0x04A7, 0x04A7, 0x0488, 0x0488, 0x0488, 0x0488, 0x0488, 0x04A8, 0x0428, 0x03E7, 0x3227, 0xF7FF, // 0x0220 (544) pixels 50 | 0xEFFF, 0x1167, 0x02D9, 0x02F9, 0x0B1A, 0x02FA, 0x0B39, 0x2C3D, 0xF7DD, 0xFFFE, 0xFFBE, 0xFFDF, 0xC7FF, 0x7E55, 0x0467, 0x0467, // 0x0230 (560) pixels 51 | 0x0C68, 0x0C68, 0x04A7, 0x0466, 0x04C7, 0x0486, 0x0467, 0x04A8, 0x0488, 0x0488, 0x0488, 0x04A8, 0x0428, 0x03E7, 0x3227, 0xF7FF, // 0x0240 (576) pixels 52 | 0xEFFF, 0x1948, 0x02F7, 0x02F7, 0x0338, 0x0338, 0x0337, 0x243A, 0xCE9D, 0xF7FF, 0xFFFF, 0xFFFF, 0xFFFD, 0xFFFD, 0x9674, 0x43EA, // 0x0250 (592) pixels 53 | 0x0447, 0x0488, 0x04A7, 0x04E8, 0x0446, 0x0487, 0x0CA8, 0x0467, 0x0C67, 0x0C67, 0x0487, 0x0487, 0x0468, 0x0427, 0x3A26, 0xFFFE, // 0x0260 (608) pixels 54 | 0xF7FF, 0x1948, 0x02F7, 0x0338, 0x0B99, 0x13BA, 0x1BD9, 0x2C7C, 0xA558, 0xF7DF, 0xFFFF, 0xFFFF, 0xFFFD, 0xFFFD, 0xDFFD, 0xB758, // 0x0270 (624) pixels 55 | 0x1D8C, 0x0488, 0x0487, 0x0487, 0x0CA8, 0x0467, 0x0C88, 0x0467, 0x0C67, 0x0C67, 0x0487, 0x0487, 0x0468, 0x0427, 0x3A26, 0xFFFE, // 0x0280 (640) pixels 56 | 0xEFFF, 0x1186, 0x5336, 0x743A, 0x9558, 0xB63B, 0xCF1A, 0xD75B, 0xFF9A, 0xFFDB, 0xFFFD, 0xFFFD, 0xFFFF, 0xFFDF, 0xFFFF, 0xFFFF, // 0x0290 (656) pixels 57 | 0xD79B, 0x640D, 0x0C48, 0x0C69, 0x0447, 0x0447, 0x0C68, 0x0447, 0x0467, 0x0467, 0x0487, 0x0487, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x02A0 (672) pixels 58 | 0xE7FF, 0x3ACB, 0xAE1F, 0xDF7F, 0xEFFF, 0xEFFF, 0xEFFE, 0xE7BD, 0xFF58, 0xF738, 0xF73A, 0xFF9C, 0xF7DF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x02B0 (688) pixels 59 | 0xEFFE, 0xDFBC, 0x1CEB, 0x0428, 0x0C68, 0x0447, 0x0447, 0x0C68, 0x0467, 0x0467, 0x0487, 0x0487, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x02C0 (704) pixels 60 | 0xFFFF, 0x738F, 0xF736, 0xFF98, 0xFF0D, 0xFE6B, 0xF646, 0xF625, 0xFDA3, 0xFE04, 0xEDC4, 0xFE66, 0xFF34, 0xFFB6, 0xFFDE, 0xFFFF, // 0x02D0 (720) pixels 61 | 0xFFBF, 0xFFDF, 0x9F78, 0x23A9, 0x0468, 0x04CA, 0x0448, 0x0489, 0x04A8, 0x04A8, 0x0487, 0x0487, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x02E0 (736) pixels 62 | 0xFFDF, 0x736F, 0xE6B4, 0xD653, 0xEDE8, 0xE5A7, 0xE5C4, 0xEDE4, 0xFD82, 0xF582, 0xEDC4, 0xEDE4, 0xE5AE, 0xFEB2, 0xFFFF, 0xFFFF, // 0x02F0 (752) pixels 63 | 0xFFDF, 0xFFBF, 0xC7FD, 0x552F, 0x0488, 0x0468, 0x0488, 0x0468, 0x04A8, 0x04A8, 0x0487, 0x0487, 0x0448, 0x0407, 0x3227, 0xF7FF, // 0x0300 (768) pixels 64 | 0xFFFD, 0x734A, 0xE584, 0xEDC5, 0xF5C1, 0xF5C1, 0xEDC0, 0xEDC0, 0xED82, 0xF5A2, 0xE5E1, 0xE5E1, 0xFDC1, 0xFDE2, 0xE6B2, 0xFFF7, // 0x0310 (784) pixels 65 | 0xFFFF, 0xF7FF, 0xEFFE, 0xA5D4, 0x0448, 0x0C89, 0x0468, 0x0468, 0x0487, 0x04A7, 0x0447, 0x0447, 0x0469, 0x03E7, 0x2A27, 0xEFFF, // 0x0320 (800) pixels 66 | 0xFFDD, 0x5AA8, 0xDD43, 0xDD64, 0xED80, 0xF5C1, 0xF5E0, 0xEDC0, 0xF5A2, 0xF5A3, 0xE5E1, 0xE5C1, 0xF5A1, 0xF5A1, 0xD60F, 0xF713, // 0x0330 (816) pixels 67 | 0xF7FF, 0xFFFF, 0xF7FE, 0xB656, 0x0427, 0x0448, 0x0488, 0x0468, 0x0487, 0x04C8, 0x0C88, 0x0426, 0x0468, 0x03E6, 0x21E6, 0xF7FF, // 0x0340 (832) pixels 68 | 0xF7FF, 0x00A2, 0xE501, 0xED62, 0xFD81, 0xFD81, 0xF562, 0xFDA3, 0xE5C0, 0xEDE0, 0xEDC1, 0xEDA0, 0xF5C0, 0xF5C0, 0xEDE3, 0xFE65, // 0x0350 (848) pixels 69 | 0xFFDE, 0xFFDE, 0xE7FC, 0xA634, 0x0487, 0x04A8, 0x0488, 0x0467, 0x04C7, 0x0487, 0x0466, 0x0487, 0x1408, 0x0BC7, 0x08A1, 0xFFFE, // 0x0360 (864) pixels 70 | 0xF7FF, 0x0060, 0xC420, 0xE542, 0xFD81, 0xFDA2, 0xFDA3, 0xF562, 0xEDE1, 0xEDE1, 0xF5E1, 0xEDC1, 0xF5C0, 0xF5C0, 0xEDC3, 0xFE24, // 0x0370 (880) pixels 71 | 0xFFBD, 0xFFDE, 0xEFFD, 0x8551, 0x0487, 0x04A7, 0x0488, 0x0488, 0x04A7, 0x04A7, 0x0487, 0x0487, 0x0BE7, 0x0345, 0x0040, 0xFFFE, // 0x0380 (896) pixels 72 | 0xFFDF, 0x0823, 0x3120, 0xACEC, 0xED83, 0xE542, 0xE582, 0xEDA3, 0xF564, 0xED64, 0xF561, 0xF561, 0xF561, 0xF561, 0xDDA7, 0xEE29, // 0x0390 (912) pixels 73 | 0xFF5C, 0xFFDF, 0xB7FB, 0x3C4B, 0x0448, 0x0489, 0x1429, 0x1429, 0x0C28, 0x0C69, 0x1408, 0x13E7, 0x3308, 0x0161, 0x0800, 0xFFFF, // 0x03A0 (928) pixels 74 | 0xFFDF, 0x0002, 0x1880, 0x3120, 0xC460, 0xDD22, 0xEDA3, 0xDD41, 0xED43, 0xE523, 0xED41, 0xED41, 0xED41, 0xED41, 0xDDA7, 0xEE29, // 0x03B0 (944) pixels 75 | 0xFF7D, 0xFF7D, 0x7E73, 0x23A9, 0x0428, 0x0448, 0x0BE8, 0x0BE8, 0x0428, 0x0408, 0x1407, 0x0345, 0x0100, 0x0080, 0x1020, 0xFFFF, // 0x03C0 (960) pixels 76 | 0xFFFE, 0x0020, 0x0802, 0x0802, 0x0040, 0x0080, 0x0020, 0x0840, 0x0840, 0x0820, 0x0801, 0x0801, 0x0020, 0x0020, 0x0040, 0x0060, // 0x03D0 (976) pixels 77 | 0x0000, 0x1062, 0x0040, 0x0060, 0x1820, 0x1000, 0x0020, 0x0040, 0x0040, 0x0060, 0x0060, 0x00A0, 0x0841, 0x0800, 0x0042, 0xF7FF, // 0x03E0 (992) pixels 78 | 0xFFFE, 0xFFFE, 0xFFDF, 0xFFBF, 0xF7FF, 0xF7FF, 0xFFFE, 0xFFFF, 0xFFFE, 0xFFFD, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF7FF, // 0x03F0 (1008) pixels 79 | 0xFFFF, 0xFFDF, 0xEFFF, 0xF7FF, 0xFFBE, 0xFFDF, 0xFFFF, 0xFFFF, 0xF7FF, 0xF7FE, 0xF7FF, 0xF7FE, 0xFFFF, 0xFFFF, 0xF7FF, 0xFFFF, // 0x0400 (1024) pixels 80 | }; 81 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo64/heart24.h: -------------------------------------------------------------------------------- 1 | // Generated by : ImageConverter 565 Online 2 | // Generated from : heart.png 3 | // Time generated : Wed, 19 Apr 17 18:35:04 +0200 (Server timezone: CET) 4 | // Image Size : 24x24 pixels 5 | // Memory usage : 1152 bytes 6 | 7 | 8 | #if defined(__AVR__) 9 | #include 10 | #elif defined(__PIC32MX__) 11 | #define PROGMEM 12 | #elif defined(__arm__) 13 | #define PROGMEM 14 | #endif 15 | 16 | const unsigned short bitmap24[576] PROGMEM={ 17 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0010 (16) pixels 18 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0020 (32) pixels 19 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0030 (48) pixels 20 | 0x0000, 0x0000, 0x0000, 0x0000, 0x9800, 0x9800, 0xA020, 0xA020, 0xA000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9800, // 0x0040 (64) pixels 21 | 0x9800, 0x9800, 0x9820, 0x9800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9800, 0xA020, 0xB102, 0xC245, 0xC205, 0xB902, // 0x0050 (80) pixels 22 | 0xB081, 0x9020, 0x2000, 0x0000, 0x0000, 0x0000, 0x9800, 0xA8A1, 0xB9C4, 0xC1C4, 0xB8E2, 0xB081, 0xA020, 0x5800, 0x0000, 0x0000, // 0x0060 (96) pixels 23 | 0x0000, 0x0000, 0xA020, 0xB9C4, 0xECEF, 0xF5F4, 0xECEF, 0xDB08, 0xC943, 0xB8C2, 0x9820, 0x4000, 0x0000, 0xA000, 0xBA25, 0xE4AE, // 0x0070 (112) pixels 24 | 0xEDB2, 0xED0F, 0xDB28, 0xC923, 0xB8A1, 0x9820, 0x2800, 0x0000, 0x0000, 0x9800, 0xB0E2, 0xE4AE, 0xF676, 0xED51, 0xE44C, 0xDB48, // 0x0080 (128) pixels 25 | 0xD1C4, 0xD163, 0xB922, 0x9020, 0x8923, 0xD42C, 0xF5F4, 0xF676, 0xED91, 0xE48D, 0xDB69, 0xD183, 0xC8C2, 0xB881, 0x8820, 0x0000, // 0x0090 (144) pixels 26 | 0x9800, 0xA020, 0xD286, 0xED71, 0xECEF, 0xDB28, 0xD1E4, 0xD1A4, 0xD163, 0xD1E4, 0xD2C7, 0xC328, 0xD4AE, 0xF655, 0xEDD3, 0xECCE, // 0x00A0 (160) pixels 27 | 0xDB49, 0xD245, 0xD1A4, 0xC902, 0xC922, 0xC922, 0xA881, 0x7000, 0x9800, 0xA881, 0xDB28, 0xECCE, 0xDB89, 0xD183, 0xD0E2, 0xD0E2, // 0x00B0 (176) pixels 28 | 0xD122, 0xD205, 0xDB28, 0xE40B, 0xECCE, 0xECAE, 0xE40B, 0xDAE7, 0xD1A3, 0xD102, 0xD0E2, 0xD122, 0xD1C4, 0xD1C4, 0xB0C2, 0x8840, // 0x00C0 (192) pixels 29 | 0xA020, 0xB0E2, 0xDAE7, 0xE40B, 0xDAC7, 0xD143, 0xD122, 0xD122, 0xD123, 0xD1A4, 0xDA46, 0xDAE7, 0xDB48, 0xDB08, 0xDA66, 0xD1C4, // 0x00D0 (208) pixels 30 | 0xD143, 0xD122, 0xD102, 0xD163, 0xD205, 0xDA46, 0xB922, 0x8860, 0x9820, 0xB122, 0xDA66, 0xDB28, 0xDA66, 0xD163, 0xD163, 0xD163, // 0x00E0 (224) pixels 31 | 0xD163, 0xD183, 0xD1A4, 0xD9C4, 0xD9E4, 0xD9C4, 0xD1A3, 0xD163, 0xD163, 0xD163, 0xD143, 0xD1A3, 0xDA86, 0xDAC7, 0xC163, 0x9061, // 0x00F0 (240) pixels 32 | 0x7000, 0xA8E2, 0xDA25, 0xDA45, 0xD9E4, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, 0xD983, // 0x0100 (256) pixels 33 | 0xD983, 0xD983, 0xD983, 0xDA25, 0xE308, 0xE2E7, 0xB963, 0x9081, 0x7000, 0x9881, 0xD9E4, 0xE205, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, // 0x0110 (272) pixels 34 | 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xD9C4, 0xE225, 0xE308, 0xEB89, 0xE2A7, 0xA902, 0x90C2, // 0x0120 (288) pixels 35 | 0x0000, 0x8840, 0xB943, 0xE205, 0xE245, 0xE245, 0xE225, 0xE204, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, 0xE1E4, // 0x0130 (304) pixels 36 | 0xE205, 0xE286, 0xEB28, 0xEBCA, 0xEB69, 0xC1A4, 0xA102, 0x9922, 0x0000, 0x0000, 0xA0E2, 0xC183, 0xEA86, 0xEAA7, 0xEAA6, 0xEA66, // 0x0140 (320) pixels 37 | 0xEA45, 0xEA25, 0xEA25, 0xEA25, 0xEA25, 0xEA25, 0xEA25, 0xEA86, 0xEB08, 0xEB89, 0xEBEB, 0xEB69, 0xC9E4, 0xA963, 0xA1E4, 0x9922, // 0x0150 (336) pixels 38 | 0x0000, 0x0000, 0x9922, 0xA142, 0xB963, 0xE286, 0xF308, 0xEAE7, 0xEAA7, 0xEA86, 0xEA66, 0xEA46, 0xEA46, 0xEA66, 0xEAC7, 0xEB49, // 0x0160 (352) pixels 39 | 0xF3CA, 0xF3EB, 0xE328, 0xB9A4, 0xA9C4, 0xAA65, 0xA1C4, 0x88A1, 0x0000, 0x0000, 0x0000, 0xA1A3, 0xA1C4, 0xB163, 0xD225, 0xEB08, // 0x0170 (368) pixels 40 | 0xF308, 0xF2C7, 0xF2A7, 0xF2A6, 0xF2C7, 0xF328, 0xF3AA, 0xF40B, 0xF3CA, 0xD286, 0xB1A3, 0xB286, 0xB2C6, 0xAA24, 0x9922, 0x0000, // 0x0180 (384) pixels 41 | 0x0000, 0x0000, 0x0000, 0x0000, 0xA1A3, 0xAA65, 0xA9C4, 0xB9A4, 0xE2C7, 0xF328, 0xF308, 0xF308, 0xF349, 0xF3CA, 0xFC2C, 0xEB89, // 0x0190 (400) pixels 42 | 0xC1E4, 0xB225, 0xBB28, 0xB2C6, 0xAA24, 0x9922, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9922, 0xAA45, 0xAA45, // 0x01A0 (416) pixels 43 | 0xB183, 0xDA86, 0xFB48, 0xFB89, 0xFBEB, 0xFC2C, 0xE348, 0xB1C4, 0xBAC7, 0xBB28, 0xB286, 0xA1C4, 0x90A1, 0x0000, 0x0000, 0x0000, // 0x01B0 (432) pixels 44 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8881, 0xA1C4, 0xAA65, 0xA983, 0xDA66, 0xFB69, 0xFBCA, 0xE328, 0xB1A4, 0xBB08, // 0x01C0 (448) pixels 45 | 0xB2E7, 0xAA45, 0x9942, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01D0 (464) pixels 46 | 0x9122, 0xAA25, 0xA983, 0xE2C7, 0xEB28, 0xB1C4, 0xBB07, 0xB2C6, 0xA9E4, 0x88C1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01E0 (480) pixels 47 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xAA04, 0xA9A4, 0xB1E4, 0xBAE7, 0xB2C6, 0xA1E4, // 0x01F0 (496) pixels 48 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0200 (512) pixels 49 | 0x0000, 0x0000, 0x0000, 0xA1C4, 0xAA24, 0xB2E7, 0xA204, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0210 (528) pixels 50 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9102, 0xA1E4, 0xA1C3, 0x80A1, 0x0000, // 0x0220 (544) pixels 51 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0230 (560) pixels 52 | 0x0000, 0x0000, 0x0000, 0x0000, 0x8040, 0x7820, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels 53 | }; 54 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo64/linux32.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : linux-icon2.png.jpg 3 | // Time generated : 2018-02-08 06:44:16.175415 UTC 4 | // Image Size : 32x32 pixels 5 | // Memory usage : 2048 bytes 6 | 7 | #include 8 | 9 | const unsigned short bitmap32[1024] PROGMEM={ 10 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0010 (16) pixels 11 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0020 (32) pixels 12 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x528A, 0x632C, 0x6B6D, // 0x0030 (48) pixels 13 | 0x632C, 0x4A69, 0x4208, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0040 (64) pixels 14 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4A69, 0x8C71, 0x94B2, 0x8C71, // 0x0050 (80) pixels 15 | 0x83F0, 0x738E, 0x528A, 0x39C6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0060 (96) pixels 16 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x630C, 0x8430, 0x8430, 0x8410, // 0x0070 (112) pixels 17 | 0x73CE, 0x632C, 0x5AAA, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0080 (128) pixels 18 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x632C, 0x7BEF, 0x7BEF, 0x7BCF, // 0x0090 (144) pixels 19 | 0x6B6D, 0x630C, 0x528A, 0x41E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00A0 (160) pixels 20 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x6B6D, 0xAD54, 0x738E, 0x6B4D, // 0x00B0 (176) pixels 21 | 0xB596, 0xBDD7, 0x4A69, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00C0 (192) pixels 22 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x9CF3, 0x18C3, 0x2965, 0x6B6D, // 0x00D0 (208) pixels 23 | 0xCE59, 0x18C3, 0x73AE, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x00E0 (224) pixels 24 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39C7, 0x6B4D, 0x1880, 0xC508, 0xBCA7, // 0x00F0 (240) pixels 25 | 0x5A67, 0x2104, 0x632C, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0100 (256) pixels 26 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41E6, 0x734A, 0xE608, 0xFF23, 0xFE60, // 0x0110 (272) pixels 27 | 0xFD40, 0xD463, 0x6AC6, 0x39C7, 0x39A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0120 (288) pixels 28 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5245, 0xE5C3, 0xFF24, 0xFEE1, 0xFE20, // 0x0130 (304) pixels 29 | 0xFDA0, 0xF4E0, 0xAB83, 0x39C7, 0x39E7, 0x39C7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0140 (320) pixels 30 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4A25, 0x93A5, 0xFE62, 0xFE66, 0xFDA3, // 0x0150 (336) pixels 31 | 0xF4A0, 0xE465, 0x7B8C, 0x39C7, 0x4A49, 0x39E7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0160 (352) pixels 32 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39C7, 0x8410, 0xE651, 0xFDE9, 0xF565, // 0x0170 (368) pixels 33 | 0xD54C, 0xB575, 0x9D14, 0x39C7, 0x4228, 0x4A69, 0x4208, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0180 (384) pixels 34 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39E7, 0x4228, 0xBDF7, 0xE73C, 0xD6BA, 0xCE59, // 0x0190 (400) pixels 35 | 0xC618, 0xBDF7, 0xB5B6, 0x632C, 0x31A6, 0x52AA, 0x4208, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01A0 (416) pixels 36 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39C7, 0x4208, 0x94B2, 0xFFDF, 0xF79E, 0xEF5D, 0xE71C, // 0x01B0 (432) pixels 37 | 0xDEDB, 0xD69A, 0xCE59, 0x9CF3, 0x3186, 0x31C6, 0x4A49, 0x39C7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01C0 (448) pixels 38 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x528A, 0xE71C, 0xFFDF, 0xF7BE, 0xF79E, 0xEF5D, // 0x01D0 (464) pixels 39 | 0xE71C, 0xDEFB, 0xD69A, 0xCE58, 0x39E7, 0x3186, 0x3186, 0x39E7, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01E0 (480) pixels 40 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x528A, 0x5ACB, 0xF79E, 0xFFDF, 0xFFDF, 0xF7BE, 0xEF7D, // 0x01F0 (496) pixels 41 | 0xE73C, 0xDEFB, 0xD69A, 0xCE59, 0x9CD3, 0x31A6, 0x31A6, 0x39A6, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0200 (512) pixels 42 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x4A69, 0x9492, 0xF79E, 0xF7BE, 0xF7BE, 0xF7BE, 0xEF7D, // 0x0210 (528) pixels 43 | 0xEF5D, 0xDEFB, 0xCE79, 0xC618, 0xD6BA, 0x4A69, 0x31A6, 0x39E7, 0x31A6, 0x3186, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0220 (544) pixels 44 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x528A, 0xEF5D, 0xF7BE, 0xF7BF, 0xF7BE, 0xF7BE, 0xEF7D, // 0x0230 (560) pixels 45 | 0xE73C, 0xDEDB, 0xC638, 0xBDD7, 0xCE59, 0x8410, 0x39C7, 0x39C7, 0x39E7, 0x3186, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels 46 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4228, 0x4A28, 0x9492, 0xFFDF, 0xFFDF, 0xFFDF, 0xF7BF, 0xF79E, 0xEF7D, // 0x0250 (592) pixels 47 | 0xE71C, 0xD6BA, 0xC618, 0xB596, 0xCE58, 0xA514, 0x39E7, 0x39C7, 0x4208, 0x3186, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0260 (608) pixels 48 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x52AA, 0x39C7, 0xC618, 0xFFDF, 0xFFDF, 0xFFDF, 0xF7BE, 0xF79E, 0xEF5D, // 0x0270 (624) pixels 49 | 0xE71C, 0xD6BA, 0xBDF7, 0xB5B6, 0xD69A, 0xBDD7, 0x4228, 0x39E7, 0x4228, 0x3186, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0280 (640) pixels 50 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4A06, 0x52AA, 0x39C7, 0xDEDB, 0xFFDF, 0xFFDF, 0xF7BE, 0xF7BE, 0xEF9E, 0xEF5D, // 0x0290 (656) pixels 51 | 0xDEFB, 0xD69A, 0xBDD7, 0xBDF7, 0xE71C, 0xC638, 0x4A69, 0x4228, 0x4A49, 0x31A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x02A0 (672) pixels 52 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xBBA2, 0xE501, 0xEDA0, 0xF6D5, 0xFFDF, 0xF7BE, 0xF7BE, 0xF79E, 0xEF7D, 0xE73C, // 0x02B0 (688) pixels 53 | 0xDEDB, 0xCE59, 0xBDF7, 0xCE59, 0xEE94, 0xC52F, 0x52AA, 0x5ACB, 0x4208, 0x7AC4, 0xCC41, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x02C0 (704) pixels 54 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFCA0, 0xFD60, 0xFEC0, 0xFE61, 0xDE56, 0xF7BE, 0xF79E, 0xEF7D, 0xEF5D, 0xE71C, // 0x02D0 (720) pixels 55 | 0xD6BA, 0xC658, 0xC618, 0xDEDA, 0xFE00, 0xCC81, 0x5AEB, 0x5ACB, 0x4A48, 0xD5C1, 0xFD00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x02E0 (736) pixels 56 | 0x0000, 0x0000, 0x0000, 0xFD00, 0xFD80, 0xFDA0, 0xFD60, 0xFD20, 0xFE40, 0xFEE0, 0xCCC2, 0x9492, 0xE73C, 0xEF5D, 0xE71C, 0xDEDB, // 0x02F0 (752) pixels 57 | 0xD69A, 0xCE59, 0xCE79, 0xEF3C, 0xFE60, 0xFDE0, 0x8344, 0x62E6, 0xB503, 0xFEC0, 0xFD60, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0300 (768) pixels 58 | 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFDC0, 0xFE60, 0xFE20, 0xFD80, 0xFDC0, 0xFEA0, 0xFE80, 0x6286, 0x632C, 0xE71C, 0xDEDB, 0xD6BA, // 0x0310 (784) pixels 59 | 0xCE79, 0xCE79, 0xDEFB, 0xF7BE, 0xFE41, 0xFE40, 0xFDE0, 0xFE80, 0xFF00, 0xFEA0, 0xFE40, 0xFD60, 0xFD20, 0x0000, 0x0000, 0x0000, // 0x0320 (800) pixels 60 | 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFD20, 0xFD80, 0xFE20, 0xFDE0, 0xFDC0, 0xFE40, 0xFEC0, 0xCC61, 0x39C7, 0xC618, 0xC638, 0xC638, // 0x0330 (816) pixels 61 | 0xC638, 0xDEDB, 0xF79E, 0xD699, 0xFE20, 0xFE40, 0xFDE0, 0xFE20, 0xFE60, 0xFE80, 0xFEC0, 0xFE60, 0xFD00, 0x0000, 0x0000, 0x0000, // 0x0340 (832) pixels 62 | 0x0000, 0x0000, 0x0000, 0xFD60, 0xFDC0, 0xFDA0, 0xFDC0, 0xFDE0, 0xFDE0, 0xFE40, 0xFE60, 0xFE40, 0xBCAA, 0xAD55, 0xBDD7, 0xCE59, // 0x0350 (848) pixels 63 | 0xDEFB, 0xF79E, 0xBDD7, 0x72C7, 0xFE20, 0xFE20, 0xFDC0, 0xFD80, 0xFD60, 0xFDC0, 0xFDA0, 0xFD20, 0xFCE1, 0x0000, 0x0000, 0x0000, // 0x0360 (864) pixels 64 | 0x0000, 0x0000, 0x0000, 0xFD80, 0xFE20, 0xFDC0, 0xFDE0, 0xFDC0, 0xFDC0, 0xFDE0, 0xFE20, 0xFE20, 0xFDA0, 0xA48F, 0xB575, 0xB596, // 0x0370 (880) pixels 65 | 0x94B2, 0x5ACB, 0x39C7, 0x8B24, 0xFE40, 0xFE00, 0xFD80, 0xFD20, 0xFD00, 0xFD00, 0xFCE1, 0xFCC2, 0xFCC1, 0x0000, 0x0000, 0x0000, // 0x0380 (896) pixels 66 | 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFD60, 0xFDC0, 0xFDC0, 0xFDC0, 0xFD80, 0xFD80, 0xFDA0, 0xFDA0, 0xFD80, 0x8AE3, 0x3186, 0x3186, // 0x0390 (912) pixels 67 | 0x3186, 0x3186, 0x3186, 0xA3A3, 0xFDE0, 0xFDA0, 0xFD40, 0xFD20, 0xFD60, 0xFD22, 0xFCE1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x03A0 (928) pixels 68 | 0x0000, 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFD20, 0xFD60, 0xFD60, 0xFD60, 0xFD40, 0xFD60, 0xFD60, 0xFD40, 0x9B23, 0x3985, 0x3186, // 0x03B0 (944) pixels 69 | 0x3186, 0x2986, 0x41C5, 0xC402, 0xFDC0, 0xFDA0, 0xFDA0, 0xFDC0, 0xFD40, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x03C0 (960) pixels 70 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFCE0, 0xFD20, 0xFD60, 0xFD40, 0xFD00, 0x0000, 0x0000, 0x0000, // 0x03D0 (976) pixels 71 | 0x0000, 0x0000, 0x0000, 0xFCC0, 0xFD20, 0xFDA0, 0xFDA0, 0xFD20, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x03E0 (992) pixels 72 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x03F0 (1008) pixels 73 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0400 (1024) pixels 74 | }; 75 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo64/smileytongue24.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : smiley_tongue_24.jpg 3 | // Time generated : 2017-04-24 16:31:50.352856 UTC 4 | // Image Size : 24x24 pixels 5 | // Memory usage : 1152 bytes 6 | 7 | #if defined(__AVR__) 8 | #include 9 | #elif defined(__PIC32MX__) 10 | #define PROGMEM 11 | #elif defined(__arm__) 12 | #define PROGMEM 13 | #endif 14 | 15 | const unsigned short bitmap24[576] PROGMEM={ 16 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0010 (16) pixels 17 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0020 (32) pixels 18 | 0x0000, 0x0000, 0x4207, 0xFFDD, 0xCE57, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0030 (48) pixels 19 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFBB, 0xFF56, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE564, 0xFF99, // 0x0040 (64) pixels 20 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xAD33, 0xF6D1, 0xE501, // 0x0050 (80) pixels 21 | 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xFF9A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0060 (96) pixels 22 | 0x0000, 0x0000, 0x0000, 0x0000, 0xFFBB, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, // 0x0070 (112) pixels 23 | 0xE501, 0xE501, 0xFF57, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFDC, 0xE501, 0xE501, 0xDD01, 0xE501, // 0x0080 (128) pixels 24 | 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xDD01, 0xE501, 0xE501, 0xFF78, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0090 (144) pixels 25 | 0x0000, 0x0000, 0x0000, 0xE501, 0xDD01, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE502, 0xE501, 0xE501, 0xDD01, 0xDD01, 0xE501, // 0x00A0 (160) pixels 26 | 0xE501, 0xDD01, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF99, 0xE501, 0xE502, 0xE501, 0x4A69, 0x4A6A, // 0x00B0 (176) pixels 27 | 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE502, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xDD01, 0x0000, 0x0000, 0x0000, // 0x00C0 (192) pixels 28 | 0x0000, 0x0000, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0x0000, 0x94B2, 0xE501, 0xE502, 0xE501, 0xE501, 0xE501, 0xE501, // 0x00D0 (208) pixels 29 | 0xDD01, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0xFFDC, 0xE501, 0xE501, 0xE501, 0x0000, 0x4A69, 0xE502, // 0x00E0 (224) pixels 30 | 0x4A69, 0x0000, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0x4A69, 0x0000, 0x0000, 0xE501, 0xE501, 0xE501, 0xFF58, 0x0000, 0x0000, // 0x00F0 (240) pixels 31 | 0x0000, 0xFF9A, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0x94B3, 0xE501, 0xE501, 0xE501, 0xE502, 0x0000, 0x0000, // 0x0100 (256) pixels 32 | 0x4A69, 0x0000, 0x0000, 0xE501, 0xE501, 0xE5A7, 0x0000, 0x0000, 0x0000, 0xFF79, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xDD01, // 0x0110 (272) pixels 33 | 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE502, 0x94B2, 0xE501, 0xE501, 0xE501, 0x0000, 0xDD01, 0xDD01, 0xE501, 0x0000, 0x0000, // 0x0120 (288) pixels 34 | 0x0000, 0xFF79, 0xE501, 0xE501, 0xFE31, 0xFD91, 0xF5B0, 0xF5F1, 0xF5EC, 0xE501, 0xDD01, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, // 0x0130 (304) pixels 35 | 0xE501, 0xE501, 0xE501, 0xE502, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0xFF9A, 0xE501, 0xE501, 0xFE31, 0xF4D0, 0xF800, 0xF800, // 0x0140 (320) pixels 36 | 0xF800, 0xDC4D, 0xE4AE, 0xE50F, 0xED90, 0xFE52, 0xE501, 0xE501, 0xE502, 0xE501, 0xE501, 0xE501, 0xE501, 0xEDA7, 0x0000, 0x0000, // 0x0150 (336) pixels 37 | 0x0000, 0xFFDC, 0xE501, 0xE501, 0xED66, 0xE48E, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xDBAC, 0xE40D, 0xF4F0, 0xF4F0, 0xF530, // 0x0160 (352) pixels 38 | 0xFD91, 0xE501, 0xE501, 0xE501, 0xE501, 0xFF57, 0x0000, 0x0000, 0x0000, 0x0000, 0xE501, 0xE501, 0xE501, 0xF800, 0xF800, 0xF800, // 0x0170 (368) pixels 39 | 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF4F0, 0xFDB1, 0xDD01, 0xE501, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, // 0x0180 (384) pixels 40 | 0x0000, 0x0000, 0xFF78, 0xE501, 0xED70, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF550, // 0x0190 (400) pixels 41 | 0xE501, 0xE501, 0xDD01, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xE501, 0xE50E, 0xF800, 0xF800, 0xF800, // 0x01A0 (416) pixels 42 | 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF4F0, 0xF550, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0x0000, 0x0000, 0x0000, // 0x01B0 (432) pixels 43 | 0x0000, 0x0000, 0x0000, 0xFFBC, 0xED90, 0xDC0D, 0xE30A, 0xF800, 0xF800, 0xDC0C, 0xE46E, 0xF510, 0xF570, 0xFE11, 0xE501, 0xE502, // 0x01C0 (448) pixels 44 | 0xDD01, 0xE501, 0xE501, 0xFF77, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF7A, 0xE4AE, 0xE3CB, 0xE36A, // 0x01D0 (464) pixels 45 | 0xDBCC, 0xDC8E, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xE501, 0xFF57, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01E0 (480) pixels 46 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF9C, 0xEDD2, 0xED2F, 0xEDB0, 0xDD01, 0xE501, 0xE501, 0xDD01, 0xE501, 0xE521, 0xE501, // 0x01F0 (496) pixels 47 | 0xE501, 0xFF99, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFBB, // 0x0200 (512) pixels 48 | 0xFF55, 0xE501, 0xE501, 0xE501, 0xE501, 0xE502, 0xE501, 0xFF79, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0210 (528) pixels 49 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xEF5B, 0xE501, 0xE501, 0x2103, 0x0000, 0x0000, // 0x0220 (544) pixels 50 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0230 (560) pixels 51 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels 52 | }; 53 | -------------------------------------------------------------------------------- /examples/MatrixGFXDemo64/yellowsmiley24.h: -------------------------------------------------------------------------------- 1 | // Generated by : UTFTConverter v0.1 2 | // Generated from : yellowsmiley24.jpg 3 | // Time generated : 2017-04-23 04:26:54.705142 UTC 4 | // Image Size : 24x24 pixels 5 | // Memory usage : 1152 bytes 6 | 7 | #if defined(__AVR__) 8 | #include 9 | #elif defined(__PIC32MX__) 10 | #define PROGMEM 11 | #elif defined(__arm__) 12 | #define PROGMEM 13 | #endif 14 | 15 | const unsigned short bitmap24[576] PROGMEM={ 16 | 0x0801, 0x0800, 0x0800, 0x0000, 0x0000, 0x0040, 0x1880, 0x6122, 0x82A1, 0xA3C4, 0xBC65, 0xC4A5, 0xCCA6, 0xBC45, 0xA383, 0x8280, // 0x0010 (16) pixels 17 | 0x5101, 0x1040, 0x0060, 0x0000, 0x0801, 0x0800, 0x0000, 0x0000, 0x0000, 0x0040, 0x0020, 0x0001, 0x1840, 0x61E0, 0xABC2, 0xD5CA, // 0x0020 (32) pixels 18 | 0xF711, 0xFFB4, 0xFFF8, 0xFFF9, 0xFFF9, 0xFFF8, 0xFF74, 0xF6F1, 0xCD68, 0xA382, 0x5160, 0x1881, 0x0001, 0x0020, 0x0040, 0x0001, // 0x0030 (48) pixels 19 | 0x0000, 0x0020, 0x0020, 0x2880, 0x8AA2, 0xD527, 0xFF51, 0xFFB7, 0xFFD7, 0xFFB5, 0xFFB5, 0xFF93, 0xFF73, 0xFF74, 0xFF95, 0xFF96, // 0x0040 (64) pixels 20 | 0xFF57, 0xFED0, 0xCC86, 0x7AA1, 0x18A0, 0x0000, 0x0020, 0x0020, 0x0800, 0x0803, 0x28C0, 0x9340, 0xE549, 0xFF56, 0xFFF7, 0xFF92, // 0x0050 (80) pixels 21 | 0xFF92, 0xFF71, 0xFF50, 0xFF70, 0xFF70, 0xFF30, 0xFF51, 0xFF31, 0xFF53, 0xFF97, 0xFF15, 0xD4C6, 0x82E0, 0x2861, 0x0802, 0x0000, // 0x0060 (96) pixels 22 | 0x0021, 0x2060, 0x8280, 0xDD69, 0xFF75, 0xFF52, 0xFF8F, 0xFF70, 0xFF50, 0xFF50, 0xFF91, 0xF750, 0xFF90, 0xFF70, 0xFF10, 0xFEF0, // 0x0070 (112) pixels 23 | 0xFECE, 0xFF30, 0xF712, 0xFED3, 0xD4C7, 0x7AA0, 0x1860, 0x0802, 0x0020, 0x61E0, 0xC465, 0xFF10, 0xFFB1, 0xFF4F, 0xFF0F, 0xFF51, // 0x0080 (128) pixels 24 | 0xFF4E, 0xFF30, 0xFF11, 0xE5CD, 0xF66F, 0xFF30, 0xFEEF, 0xFF0F, 0xFED0, 0xFEAF, 0xFEED, 0xFEF0, 0xFE70, 0xB3E3, 0x5A00, 0x0820, // 0x0090 (144) pixels 25 | 0x3081, 0xA381, 0xFE6C, 0xFF13, 0xFF10, 0xFEEE, 0xFF2F, 0xFF4E, 0xFF2E, 0xFF0F, 0xDE0D, 0xBCC9, 0xE62D, 0xFEEF, 0xFEEE, 0xFEEE, // 0x00A0 (160) pixels 26 | 0xFEEE, 0xF6AF, 0xFE6C, 0xFE6E, 0xFE94, 0xEDAB, 0x9B40, 0x2060, 0x7220, 0xBCA6, 0xFECD, 0xFEEF, 0xFECD, 0xFF2E, 0xFEEE, 0xFEEE, // 0x00B0 (176) pixels 27 | 0xFEED, 0xFEAE, 0xC4A8, 0xBC88, 0xFEAF, 0xFECE, 0xFECE, 0xFE8D, 0xFE6D, 0xFE6E, 0xFE8E, 0xFE6C, 0xFE2D, 0xFE8E, 0xAC44, 0x71A1, // 0x00C0 (192) pixels 28 | 0x8B01, 0xED49, 0xFE8C, 0xFEEC, 0xFECD, 0xFEAD, 0xFECD, 0xFECD, 0xFEED, 0xEE0C, 0xB3E6, 0xDD6A, 0xFE8B, 0xFE8B, 0xFEAC, 0xFE4C, // 0x00D0 (208) pixels 29 | 0xCCEA, 0xEDAB, 0xFE6B, 0xFE2B, 0xFE0D, 0xFE0D, 0xD4A7, 0x8AE0, 0x9341, 0xF5AA, 0xFEAD, 0xFE8B, 0xFE8B, 0xFE6B, 0xFE4A, 0xFE68, // 0x00E0 (224) pixels 30 | 0xFE47, 0xCCC2, 0xB3A0, 0xFDE7, 0xFDE5, 0xFE05, 0xF5E6, 0xCC84, 0xA363, 0xED89, 0xFE09, 0xFE0A, 0xFDEB, 0xFDCB, 0xE549, 0x9320, // 0x00F0 (240) pixels 31 | 0x9BA1, 0xFDA9, 0xFE4B, 0xFE4A, 0xFE48, 0xF5A7, 0xD482, 0xFE24, 0xFDE5, 0xFDE5, 0xFDE4, 0xFDE5, 0xFDC4, 0xFDE4, 0xF585, 0xA2C0, // 0x0100 (256) pixels 32 | 0xAB20, 0xFD67, 0xFD86, 0xFDA7, 0xFDC9, 0xFDA9, 0xED89, 0x9340, 0x9360, 0xFDC8, 0xFE0A, 0xFDE8, 0xFDE5, 0xFDC7, 0xBB80, 0xFDE4, // 0x0110 (272) pixels 33 | 0xFDC6, 0xFDE6, 0xFD84, 0xFDC5, 0xFDE6, 0xFDA5, 0xD463, 0xA2E1, 0xD442, 0xFD45, 0xFD44, 0xFD45, 0xFD46, 0xFD67, 0xED27, 0x9B40, // 0x0120 (288) pixels 34 | 0x9B61, 0xFD67, 0xFDA7, 0xFDA5, 0xFDA3, 0xFDE7, 0xCC02, 0xF584, 0xFDC5, 0xFDA6, 0xFDA5, 0xFDA4, 0xFDA4, 0xFD85, 0xE4C4, 0xC3C0, // 0x0130 (304) pixels 35 | 0xFD45, 0xFD23, 0xFD23, 0xFD24, 0xFCC4, 0xFD05, 0xECC5, 0xA361, 0x9B62, 0xECC4, 0xFD44, 0xFD84, 0xFD83, 0xF564, 0xE4C5, 0xCC42, // 0x0140 (320) pixels 36 | 0xFD63, 0xFD64, 0xFD85, 0xFD63, 0xFD84, 0xFD24, 0xFD65, 0xFD43, 0xFD44, 0xFD23, 0xFD03, 0xFD04, 0xFCA3, 0xFCA3, 0xE484, 0x9B21, // 0x0150 (336) pixels 37 | 0x9341, 0xE463, 0xFD64, 0xFD44, 0xFD44, 0xFD64, 0xFD66, 0xCBE2, 0xECE4, 0xFD86, 0xFD24, 0xFD44, 0xFD23, 0xFD45, 0xFD04, 0xFD24, // 0x0160 (352) pixels 38 | 0xFD04, 0xFCE3, 0xFCC3, 0xFCC4, 0xFCA3, 0xFC82, 0xD423, 0x8AE0, 0x8B40, 0xCBC0, 0xF502, 0xFD04, 0xFD25, 0xFD43, 0xFD44, 0xF506, // 0x0170 (368) pixels 39 | 0xBB80, 0xDC82, 0xF523, 0xFD44, 0xFD25, 0xFD04, 0xFD04, 0xFCE4, 0xF483, 0xFCA3, 0xFCA4, 0xFC83, 0xFC82, 0xF462, 0xBBA1, 0x8B00, // 0x0180 (384) pixels 40 | 0x72E0, 0xB341, 0xECA3, 0xFCE3, 0xFCC4, 0xFD03, 0xFD04, 0xFD44, 0xF527, 0xDC64, 0xCC02, 0xCC22, 0xCC22, 0xD402, 0xD422, 0xDC23, // 0x0190 (400) pixels 41 | 0xD402, 0xEC42, 0xFC42, 0xFC64, 0xEC82, 0xDC42, 0xA322, 0x7AC0, 0x61A1, 0x8320, 0xD402, 0xFC82, 0xFD05, 0xFCE4, 0xFCE1, 0xFCE3, // 0x01A0 (416) pixels 42 | 0xFD05, 0xFCE5, 0xF4E6, 0xFCE7, 0xFCC6, 0xFCC5, 0xF4A4, 0xF483, 0xFC83, 0xFC83, 0xFCA4, 0xF442, 0xFC23, 0xD3E2, 0x8300, 0x4900, // 0x01B0 (432) pixels 43 | 0x1840, 0x82E2, 0x9B20, 0xDC03, 0xFC82, 0xF4C3, 0xFCA3, 0xFC83, 0xFCA2, 0xFCA3, 0xFCC3, 0xFCA2, 0xFC82, 0xFC82, 0xFC82, 0xFC62, // 0x01C0 (448) pixels 44 | 0xFC43, 0xFC63, 0xEC42, 0xFC42, 0xD3C1, 0x8B20, 0x7AA2, 0x1840, 0x0020, 0x4980, 0x9320, 0xA361, 0xDC23, 0xFCA2, 0xFCA4, 0xFC85, // 0x01D0 (464) pixels 45 | 0xFC84, 0xFC83, 0xFC83, 0xFC82, 0xFC62, 0xFC63, 0xFC63, 0xFC44, 0xFC24, 0xFC62, 0xFC21, 0xDBC3, 0x9B60, 0x8300, 0x4181, 0x0800, // 0x01E0 (480) pixels 46 | 0x0000, 0x1041, 0x6A61, 0x8B00, 0xA360, 0xD3E3, 0xF463, 0xF482, 0xFC82, 0xFC62, 0xFC43, 0xFC43, 0xFC23, 0xFC43, 0xFC22, 0xFC22, // 0x01F0 (496) pixels 47 | 0xFC82, 0xEC03, 0xCB81, 0xA380, 0x9340, 0x6A00, 0x0020, 0x0000, 0x0000, 0x0000, 0x0800, 0x6A62, 0x8B00, 0x9B41, 0xBB81, 0xDC41, // 0x0200 (512) pixels 48 | 0xEC62, 0xFCA3, 0xFCC3, 0xFC82, 0xFC62, 0xFC83, 0xFC83, 0xEC62, 0xD400, 0xC381, 0x9341, 0x8B00, 0x6201, 0x0821, 0x0000, 0x0020, // 0x0210 (528) pixels 49 | 0x0001, 0x0020, 0x0001, 0x0821, 0x59C0, 0x8B01, 0x8B40, 0xAB00, 0xB341, 0xBBA2, 0xCBE2, 0xCC01, 0xCBE1, 0xCBC1, 0xBBA2, 0xB341, // 0x0220 (544) pixels 50 | 0xA321, 0x8B40, 0x82E1, 0x5180, 0x0840, 0x0001, 0x0020, 0x0001, 0x0000, 0x0002, 0x0000, 0x0020, 0x0800, 0x3080, 0x7201, 0x8340, // 0x0230 (560) pixels 51 | 0x8B40, 0x8B20, 0x9320, 0x9B40, 0x9B40, 0x9340, 0x8B40, 0x8B20, 0x8300, 0x6A22, 0x2880, 0x0020, 0x0000, 0x0800, 0x0001, 0x0000, // 0x0240 (576) pixels 52 | }; 53 | -------------------------------------------------------------------------------- /examples/NeoMatrix_LEDMatrix/LEDMatrix_Flag.ino: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | 4 | void sprite_setup() 5 | { 6 | Serial.println("ledmatrix setup"); 7 | ledmatrix.DrawLine (0, 0, ledmatrix.Width() - 1, ledmatrix.Height() - 1, CRGB(0, 255, 0)); 8 | ledmatrix.DrawPixel(0, 0, CRGB(255, 0, 0)); 9 | ledmatrix.DrawPixel(ledmatrix.Width() - 1, ledmatrix.Height() - 1, CRGB(0, 0, 255)); 10 | FastLED.show(); 11 | Serial.println("ledmatrix setup done"); 12 | } 13 | 14 | 15 | void flag() 16 | { 17 | matrix_clear(); 18 | ledmatrix.DrawFilledRectangle(0, 0, ledmatrix.Width() - 1, ledmatrix.Height() - 1, CRGB(0, 0, 255)); 19 | ledmatrix.DrawRectangle(0, 0, ledmatrix.Width() - 1, ledmatrix.Height() - 1, CRGB(255, 255, 255)); 20 | ledmatrix.DrawLine(0, 0, ledmatrix.Width() - 1, ledmatrix.Height() - 1, CRGB(255, 255, 255)); 21 | ledmatrix.DrawLine(0, 1, ledmatrix.Width() - 1, ledmatrix.Height() - 2, CRGB(255, 255, 255)); 22 | ledmatrix.DrawLine(0, ledmatrix.Height() - 1, ledmatrix.Width() - 1, 0, CRGB(255, 255, 255)); 23 | ledmatrix.DrawLine(0, ledmatrix.Height() - 2, ledmatrix.Width() - 1, 1, CRGB(255, 255, 255)); 24 | FastLED.show(); 25 | } 26 | -------------------------------------------------------------------------------- /examples/NeoMatrix_LEDMatrix/NeoMatrix_LEDMatrix.ino: -------------------------------------------------------------------------------- 1 | // FastLED_NeoMatrix + LEDMatrix example 2 | // 3 | // https://github.com/marcmerlin/FastLED_NeoMatrix 4 | // https://github.com/Jorgen-VikingGod/LEDMatrix 5 | // 6 | // By Marc MERLIN 7 | // License: BSD-2 8 | 9 | #include "config.h" 10 | 11 | 12 | #if defined(ESP32) or defined(ESP8266) 13 | #define PIN 5 14 | #else 15 | #define PIN 13 16 | #endif 17 | 18 | // cLEDMatrix defines 19 | cLEDMatrix<-MATRIX_TILE_WIDTH, -MATRIX_TILE_HEIGHT, HORIZONTAL_ZIGZAG_MATRIX, 20 | MATRIX_TILE_H, MATRIX_TILE_V, HORIZONTAL_BLOCKS> ledmatrix; 21 | 22 | 23 | // Normally we would define this: 24 | //CRGB leds[NUMMATRIX]; 25 | 26 | // cLEDMatrix creates a FastLED array inside its object and we need to retrieve 27 | // a pointer to its first element to act as a regular FastLED array, necessary 28 | // for NeoMatrix and other operations that may work directly on the array like FadeAll. 29 | CRGB *leds = ledmatrix[0]; 30 | 31 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, MATRIX_TILE_WIDTH, MATRIX_TILE_HEIGHT, 32 | MATRIX_TILE_H, MATRIX_TILE_V, 33 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 34 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG + 35 | NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_PROGRESSIVE); 36 | 37 | void matrix_clear() { 38 | // FastLED.clear does not work properly with multiple matrices connected via parallel inputs 39 | // on ESP8266 (not sure about other chips). 40 | memset(leds, 0, NUMMATRIX*3); 41 | } 42 | 43 | 44 | // This could also be defined as matrix->color(255,0,0) but those defines 45 | // are meant to work for adafruit_gfx backends that are lacking color() 46 | #define LED_BLACK 0 47 | 48 | #define LED_RED_VERYLOW (3 << 11) 49 | #define LED_RED_LOW (7 << 11) 50 | #define LED_RED_MEDIUM (15 << 11) 51 | #define LED_RED_HIGH (31 << 11) 52 | 53 | #define LED_GREEN_VERYLOW (1 << 5) 54 | #define LED_GREEN_LOW (15 << 5) 55 | #define LED_GREEN_MEDIUM (31 << 5) 56 | #define LED_GREEN_HIGH (63 << 5) 57 | 58 | #define LED_BLUE_VERYLOW 3 59 | #define LED_BLUE_LOW 7 60 | #define LED_BLUE_MEDIUM 15 61 | #define LED_BLUE_HIGH 31 62 | 63 | #define LED_ORANGE_VERYLOW (LED_RED_VERYLOW + LED_GREEN_VERYLOW) 64 | #define LED_ORANGE_LOW (LED_RED_LOW + LED_GREEN_LOW) 65 | #define LED_ORANGE_MEDIUM (LED_RED_MEDIUM + LED_GREEN_MEDIUM) 66 | #define LED_ORANGE_HIGH (LED_RED_HIGH + LED_GREEN_HIGH) 67 | 68 | #define LED_PURPLE_VERYLOW (LED_RED_VERYLOW + LED_BLUE_VERYLOW) 69 | #define LED_PURPLE_LOW (LED_RED_LOW + LED_BLUE_LOW) 70 | #define LED_PURPLE_MEDIUM (LED_RED_MEDIUM + LED_BLUE_MEDIUM) 71 | #define LED_PURPLE_HIGH (LED_RED_HIGH + LED_BLUE_HIGH) 72 | 73 | #define LED_CYAN_VERYLOW (LED_GREEN_VERYLOW + LED_BLUE_VERYLOW) 74 | #define LED_CYAN_LOW (LED_GREEN_LOW + LED_BLUE_LOW) 75 | #define LED_CYAN_MEDIUM (LED_GREEN_MEDIUM + LED_BLUE_MEDIUM) 76 | #define LED_CYAN_HIGH (LED_GREEN_HIGH + LED_BLUE_HIGH) 77 | 78 | #define LED_WHITE_VERYLOW (LED_RED_VERYLOW + LED_GREEN_VERYLOW + LED_BLUE_VERYLOW) 79 | #define LED_WHITE_LOW (LED_RED_LOW + LED_GREEN_LOW + LED_BLUE_LOW) 80 | #define LED_WHITE_MEDIUM (LED_RED_MEDIUM + LED_GREEN_MEDIUM + LED_BLUE_MEDIUM) 81 | #define LED_WHITE_HIGH (LED_RED_HIGH + LED_GREEN_HIGH + LED_BLUE_HIGH) 82 | 83 | // In a case of a tile of neomatrices, this test is helpful to make sure that the 84 | // pixels are all in sequence (to check your wiring order and the tile options you 85 | // gave to the constructor). 86 | void count_pixels() { 87 | matrix_clear(); 88 | for (uint16_t i=0; idrawPixel(j, i, i%3==0?(uint16_t)LED_BLUE_HIGH:i%3==1?(uint16_t)LED_RED_HIGH:(uint16_t)LED_GREEN_HIGH); 91 | // depending on the matrix size, it's too slow to display each pixel, so 92 | // make the scan init faster. This will however be too fast on a small matrix. 93 | #ifdef ESP8266 94 | if (!(j%3)) matrix->show(); 95 | yield(); // reset watchdog timer 96 | #elif ESP32 97 | delay(1); 98 | matrix->show(); 99 | #else 100 | matrix->show(); 101 | #endif 102 | } 103 | } 104 | } 105 | 106 | void display_lines() { 107 | matrix_clear(); 108 | 109 | // 4 levels of crossing red lines. 110 | matrix->drawLine(0,mh/2-2, mw-1,2, LED_RED_VERYLOW); 111 | matrix->drawLine(0,mh/2-1, mw-1,3, LED_RED_LOW); 112 | matrix->drawLine(0,mh/2, mw-1,mh/2, LED_RED_MEDIUM); 113 | matrix->drawLine(0,mh/2+1, mw-1,mh/2+1, LED_RED_HIGH); 114 | 115 | // 4 levels of crossing green lines. 116 | matrix->drawLine(mw/2-2, 0, mw/2-2, mh-1, LED_GREEN_VERYLOW); 117 | matrix->drawLine(mw/2-1, 0, mw/2-1, mh-1, LED_GREEN_LOW); 118 | matrix->drawLine(mw/2+0, 0, mw/2+0, mh-1, LED_GREEN_MEDIUM); 119 | matrix->drawLine(mw/2+1, 0, mw/2+1, mh-1, LED_GREEN_HIGH); 120 | 121 | // Diagonal blue line. 122 | matrix->drawLine(0,0, mw-1,mh-1, LED_BLUE_HIGH); 123 | matrix->drawLine(0,mh-1, mw-1,0, LED_ORANGE_MEDIUM); 124 | matrix->show(); 125 | } 126 | 127 | void display_boxes() { 128 | matrix_clear(); 129 | matrix->drawRect(0,0, mw,mh, LED_BLUE_HIGH); 130 | matrix->drawRect(1,1, mw-2,mh-2, LED_GREEN_MEDIUM); 131 | matrix->fillRect(2,2, mw-4,mh-4, LED_RED_HIGH); 132 | matrix->fillRect(3,3, mw-6,mh-6, LED_ORANGE_MEDIUM); 133 | matrix->show(); 134 | } 135 | 136 | void display_circles() { 137 | matrix_clear(); 138 | matrix->drawCircle(mw/2,mh/2, 2, LED_RED_MEDIUM); 139 | matrix->drawCircle(mw/2-1-min(mw,mh)/8, mh/2-1-min(mw,mh)/8, min(mw,mh)/4, LED_BLUE_HIGH); 140 | matrix->drawCircle(mw/2+1+min(mw,mh)/8, mh/2+1+min(mw,mh)/8, min(mw,mh)/4-1, LED_ORANGE_MEDIUM); 141 | matrix->drawCircle(1,mh-2, 1, LED_GREEN_LOW); 142 | matrix->drawCircle(mw-2,1, 1, LED_GREEN_HIGH); 143 | if (min(mw,mh)>12) matrix->drawCircle(mw/2-1, mh/2-1, min(mh/2-1,mw/2-1), LED_CYAN_HIGH); 144 | matrix->show(); 145 | } 146 | 147 | 148 | void loop() { 149 | #if 0 150 | Serial.println("Count pixels"); 151 | count_pixels(); 152 | Serial.println("Count pixels done"); 153 | delay(1000); 154 | #endif 155 | 156 | Serial.println("Use LEDMatrix to display a flag"); 157 | flag(); 158 | delay(3000); 159 | matrix_clear(); 160 | 161 | Serial.println("Back to NeoMatrix/GFX to Display lines, boxes and circles"); 162 | display_lines(); 163 | delay(3000); 164 | 165 | display_boxes(); 166 | delay(3000); 167 | 168 | display_circles(); 169 | delay(3000); 170 | matrix_clear(); 171 | 172 | 173 | Serial.println("Demo loop done, starting over"); 174 | } 175 | 176 | void setup() { 177 | // Normal output 178 | FastLED.addLeds(leds, NUMMATRIX).setCorrection(TypicalLEDStrip); 179 | // Parallel output on 3 lines (ESP8266) 180 | //FastLED.addLeds(leds, NUMMATRIX/3).setCorrection(TypicalLEDStrip); 181 | // Time for serial port to work? 182 | delay(1000); 183 | Serial.begin(115200); 184 | Serial.print("Matrix Size: "); 185 | Serial.print(mw); 186 | Serial.print(" "); 187 | Serial.println(mh); 188 | matrix->begin(); 189 | matrix->setTextWrap(false); 190 | matrix->setBrightness(BRIGHTNESS); 191 | // Mix in an init of LEDMatrix 192 | sprite_setup(); 193 | delay(2000); 194 | Serial.println("If the code crashes here, decrease the brightness or turn off the all white display below"); 195 | // Test full bright of all LEDs. If brightness is too high 196 | // for your current limit (i.e. USB), decrease it. 197 | #ifndef DISABLE_WHITE 198 | matrix->fillScreen(LED_WHITE_HIGH); 199 | matrix->show(); 200 | Serial.println("First matrix->show did not crash/hang, trying clear"); 201 | delay(3000); 202 | matrix_clear(); 203 | Serial.println("First matrix_clear done"); 204 | #endif 205 | } 206 | 207 | // vim:sts=4:sw=4 208 | -------------------------------------------------------------------------------- /examples/NeoMatrix_LEDMatrix/README: -------------------------------------------------------------------------------- 1 | FastLED and LEDMatrix both have features that you might want to use. 2 | It is possible to define a single FastLED strip used as a matrix, and 3 | alternate between NeoMatrix and LEDMatrix writing to it. 4 | 5 | This example code shows how. 6 | 7 | Enjoy, Marc 8 | -------------------------------------------------------------------------------- /examples/NeoMatrix_LEDMatrix/config.h: -------------------------------------------------------------------------------- 1 | #ifndef config_h 2 | #define config_h 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | // 9 | // Used by LEDMatrix 10 | #define MATRIX_TILE_WIDTH 8 // width of EACH NEOPIXEL MATRIX (not total display) 11 | #define MATRIX_TILE_HEIGHT 32 // height of each matrix 12 | #define MATRIX_TILE_H 3 // number of matrices arranged horizontally 13 | #define MATRIX_TILE_V 1 // number of matrices arranged vertically 14 | 15 | // Used by NeoMatrix 16 | #define mw (MATRIX_TILE_WIDTH * MATRIX_TILE_H) 17 | #define mh (MATRIX_TILE_HEIGHT * MATRIX_TILE_V) 18 | #define NUMMATRIX (mw*mh) 19 | 20 | // Compat for some other demos 21 | #define NUM_LEDS NUMMATRIX 22 | #define MATRIX_HEIGHT mh 23 | #define MATRIX_WIDTH mw 24 | 25 | #define BRIGHTNESS 32 26 | #endif 27 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos is populated from 2 | https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/ 3 | 4 | Please run git submodule update --init --recursive 5 | 6 | MatrixGFXDemo shows how to use this drier directly without worrying 7 | about the combined neomatrix_config.h backend. 8 | 9 | Other examples under FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos use the 10 | complex looking neomatrix_config.h that allows to move your code back and forth 11 | between the different drivers that use the Framebuffer::GFX backend (like the 12 | FastLED::NeoMatrix, SmartMatrix::GFX, and FastLED_SPITFT::GFX drivers) 13 | -------------------------------------------------------------------------------- /examples/espgifread/GifPlayer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Aurora: https://github.com/pixelmatix/aurora 3 | * Copyright (c) 2014 Jason Coon 4 | * 5 | * Portions of this code are adapted from Craig Lindley's LightAppliance: https://github.com/CraigLindley/LightAppliance 6 | * Copyright (c) 2014 Craig A. Lindley 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 9 | * this software and associated documentation files (the "Software"), to deal in 10 | * the Software without restriction, including without limitation the rights to 11 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 12 | * the Software, and to permit persons to whom the Software is furnished to do so, 13 | * subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in all 16 | * copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 20 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 21 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 22 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | */ 25 | 26 | #ifndef GifPlayer_H 27 | #define GifPlayer_H 28 | 29 | #include "config.h" 30 | 31 | #define DEBUG 0 32 | 33 | #include "pixeltypes.h" 34 | 35 | class GifPlayer { 36 | public: 37 | 38 | // Error codes 39 | #define ERROR_NONE 0 40 | #define ERROR_FILEOPEN 1 41 | #define ERROR_FILENOTGIF 2 42 | #define ERROR_BADGIFFORMAT 3 43 | #define ERROR_UNKNOWNCONTROLEXT 4 44 | #define ERROR_FINISHED 5 45 | 46 | private: 47 | 48 | #define GIFHDRTAGNORM "GIF87a" // tag in valid GIF file 49 | #define GIFHDRTAGNORM1 "GIF89a" // tag in valid GIF file 50 | #define GIFHDRSIZE 6 51 | 52 | // Global GIF specific definitions 53 | #define COLORTBLFLAG 0x80 54 | #define INTERLACEFLAG 0x40 55 | #define TRANSPARENTFLAG 0x01 56 | 57 | #define NO_TRANSPARENT_INDEX -1 58 | 59 | // Disposal methods 60 | #define DISPOSAL_NONE 0 61 | #define DISPOSAL_LEAVE 1 62 | #define DISPOSAL_BACKGROUND 2 63 | #define DISPOSAL_RESTORE 3 64 | 65 | // RGB data structure 66 | typedef struct { 67 | byte Red; 68 | byte Green; 69 | byte Blue; 70 | } 71 | _RGB; 72 | 73 | // Logical screen descriptor attributes 74 | int lsdWidth; 75 | int lsdHeight; 76 | int lsdPackedField; 77 | int lsdAspectRatio; 78 | int lsdBackgroundIndex; 79 | 80 | // Table based image attributes 81 | int tbiImageX; 82 | int tbiImageY; 83 | int tbiWidth; 84 | int tbiHeight; 85 | int tbiPackedBits; 86 | boolean tbiInterlaced; 87 | 88 | int frameDelay; 89 | int transparentColorIndex; 90 | int prevBackgroundIndex; 91 | int prevDisposalMethod; 92 | int disposalMethod; 93 | int lzwCodeSize; 94 | boolean keyFrame; 95 | int rectX; 96 | int rectY; 97 | int rectWidth; 98 | int rectHeight; 99 | 100 | int colorCount; 101 | _RGB gifPalette[256]; 102 | 103 | byte lzwImageData[1280]; 104 | char tempBuffer[260]; 105 | 106 | File file; 107 | 108 | byte imageData[1024]; 109 | byte imageDataBU[1024]; 110 | 111 | // Backup the read stream by n bytes 112 | void backUpStream(int n) { 113 | file.seek(file.position() - n); 114 | } 115 | 116 | // Read a file byte 117 | int readByte() { 118 | 119 | int b = file.read(); 120 | #if DEBUG == 1 121 | if (b == -1) { 122 | Serial.println(F("Read error or EOF occurred")); 123 | } 124 | #endif 125 | return b; 126 | } 127 | 128 | // Read a file word 129 | int readWord() { 130 | 131 | int b0 = readByte(); 132 | int b1 = readByte(); 133 | return (b1 << 8) | b0; 134 | } 135 | 136 | // Read the specified number of bytes into the specified buffer 137 | int readIntoBuffer(void *buffer, int numberOfBytes) { 138 | 139 | //int result = file.read(buffer, numberOfBytes); 140 | int result = file.read((uint8_t *)buffer, (size_t)numberOfBytes); 141 | #if DEBUG == 1 142 | if (result == -1) { 143 | Serial.println(F("Read error or EOF occurred")); 144 | } 145 | #endif 146 | return result; 147 | } 148 | 149 | // Fill a portion of imageData buffer with a color index 150 | void fillImageDataRect(byte colorIndex, int x, int y, int width, int height) { 151 | 152 | int yOffset; 153 | 154 | for (int yy = y; yy < height + y; yy++) { 155 | yOffset = yy * MATRIX_WIDTH; 156 | for (int xx = x; xx < width + x; xx++) { 157 | imageData[yOffset + xx] = colorIndex; 158 | } 159 | } 160 | } 161 | 162 | // Fill entire imageData buffer with a color index 163 | void fillImageData(byte colorIndex) { 164 | 165 | memset(imageData, colorIndex, sizeof(imageData)); 166 | } 167 | 168 | // Copy image data in rect from a src to a dst 169 | void copyImageDataRect(byte *src, byte *dst, int x, int y, int width, int height) { 170 | 171 | int yOffset, offset; 172 | 173 | for (int yy = y; yy < height + y; yy++) { 174 | yOffset = yy * MATRIX_WIDTH; 175 | for (int xx = x; xx < width + x; xx++) { 176 | offset = yOffset + xx; 177 | dst[offset] = src[offset]; 178 | } 179 | } 180 | } 181 | 182 | // Parse plain text extension and dispose of it 183 | void parsePlainTextExtension() { 184 | 185 | #if DEBUG == 1 186 | Serial.println(F("\nProcessing Plain Text Extension")); 187 | #endif 188 | // Read plain text header length 189 | byte len = readByte(); 190 | 191 | // Consume plain text header data 192 | readIntoBuffer(tempBuffer, len); 193 | 194 | // Consume the plain text data in blocks 195 | len = readByte(); 196 | while (len != 0) { 197 | readIntoBuffer(tempBuffer, len); 198 | len = readByte(); 199 | } 200 | } 201 | 202 | // Parse a graphic control extension 203 | void parseGraphicControlExtension() { 204 | 205 | #if DEBUG == 1 206 | Serial.println(F("\nProcessing Graphic Control Extension")); 207 | int len = readByte(); // Check length 208 | if (len != 4) { 209 | Serial.println(F("Bad graphic control extension")); 210 | } 211 | #else 212 | readByte(); 213 | #endif 214 | 215 | int packedBits = readByte(); 216 | frameDelay = readWord(); 217 | transparentColorIndex = readByte(); 218 | 219 | if ((packedBits & TRANSPARENTFLAG) == 0) { 220 | // Indicate no transparent index 221 | transparentColorIndex = NO_TRANSPARENT_INDEX; 222 | } 223 | disposalMethod = (packedBits >> 2) & 7; 224 | if (disposalMethod > 3) { 225 | disposalMethod = 0; 226 | #if DEBUG == 1 227 | Serial.println(F("Invalid disposal value")); 228 | #endif 229 | } 230 | 231 | readByte(); // Toss block end 232 | 233 | #if DEBUG == 1 234 | Serial.print(F("PacketBits: ")); 235 | Serial.println(packedBits, HEX); 236 | Serial.print(F("Frame delay: ")); 237 | Serial.println(frameDelay); 238 | Serial.print(F("transparentColorIndex: ")); 239 | Serial.println(transparentColorIndex); 240 | Serial.print(F("disposalMethod: ")); 241 | Serial.println(disposalMethod); 242 | #endif 243 | } 244 | 245 | // Parse application extension 246 | void parseApplicationExtension() { 247 | 248 | memset(tempBuffer, 0, sizeof(tempBuffer)); 249 | 250 | #if DEBUG == 1 251 | Serial.println(F("\nProcessing Application Extension")); 252 | #endif 253 | 254 | // Read block length 255 | byte len = readByte(); 256 | 257 | // Read app data 258 | readIntoBuffer(tempBuffer, len); 259 | 260 | #if DEBUG == 1 261 | // Conditionally display the application extension string 262 | if (strlen(tempBuffer) != 0) { 263 | Serial.print(F("Application Extension: ")); 264 | Serial.println(tempBuffer); 265 | } 266 | #endif 267 | 268 | // Consume any additional app data 269 | len = readByte(); 270 | while (len != 0) { 271 | readIntoBuffer(tempBuffer, len); 272 | len = readByte(); 273 | } 274 | } 275 | 276 | // Parse comment extension 277 | void parseCommentExtension() { 278 | 279 | #if DEBUG == 1 280 | Serial.println(F("\nProcessing Comment Extension")); 281 | #endif 282 | 283 | // Read block length 284 | byte len = readByte(); 285 | while (len != 0) { 286 | // Clear buffer 287 | memset(tempBuffer, 0, sizeof(tempBuffer)); 288 | 289 | // Read len bytes into buffer 290 | readIntoBuffer(tempBuffer, len); 291 | 292 | #if DEBUG == 1 293 | // Display the comment extension string 294 | if (strlen(tempBuffer) != 0) { 295 | Serial.print(F("Comment Extension: ")); 296 | Serial.println(tempBuffer); 297 | } 298 | #endif 299 | // Read the new block length 300 | len = readByte(); 301 | } 302 | } 303 | 304 | // Parse file terminator 305 | int parseGIFFileTerminator() { 306 | 307 | #if DEBUG == 1 308 | Serial.println(F("\nProcessing file terminator")); 309 | #endif 310 | 311 | byte b = readByte(); 312 | if (b != 0x3B) { 313 | 314 | #if DEBUG == 1 315 | Serial.print(F("Terminator byte: ")); 316 | Serial.println(b, HEX); 317 | Serial.println(F("Bad GIF file format - Bad terminator")); 318 | #endif 319 | return ERROR_BADGIFFORMAT; 320 | } 321 | else { 322 | return ERROR_NONE; 323 | } 324 | } 325 | 326 | // Parse table based image data 327 | unsigned long parseTableBasedImage() { 328 | 329 | #if DEBUG == 1 330 | Serial.println(F("\nProcessing Table Based Image Descriptor")); 331 | #endif 332 | 333 | // Parse image descriptor 334 | tbiImageX = readWord(); 335 | tbiImageY = readWord(); 336 | tbiWidth = readWord(); 337 | tbiHeight = readWord(); 338 | tbiPackedBits = readByte(); 339 | 340 | #if DEBUG == 1 341 | Serial.print(F("tbiImageX: ")); 342 | Serial.println(tbiImageX); 343 | Serial.print(F("tbiImageY: ")); 344 | Serial.println(tbiImageY); 345 | Serial.print(F("tbiWidth: ")); 346 | Serial.println(tbiWidth); 347 | Serial.print(F("tbiHeight: ")); 348 | Serial.println(tbiHeight); 349 | Serial.print(F("PackedBits: ")); 350 | Serial.println(tbiPackedBits, HEX); 351 | #endif 352 | 353 | // Is this image interlaced ? 354 | tbiInterlaced = ((tbiPackedBits & INTERLACEFLAG) != 0); 355 | 356 | #if DEBUG == 1 357 | Serial.print(F("Image interlaced: ")); 358 | Serial.println((tbiInterlaced != 0) ? "Yes" : "No"); 359 | #endif 360 | 361 | // Does this image have a local color table ? 362 | boolean localColorTable = ((tbiPackedBits & COLORTBLFLAG) != 0); 363 | 364 | if (localColorTable) { 365 | int colorBits = ((tbiPackedBits & 7) + 1); 366 | colorCount = 1 << colorBits; 367 | 368 | #if DEBUG == 1 369 | Serial.print(F("Local color table with ")); 370 | Serial.print(colorCount); 371 | Serial.println(F(" colors present")); 372 | #endif 373 | // Read colors into palette 374 | int colorTableBytes = sizeof(_RGB) * colorCount; 375 | readIntoBuffer(gifPalette, colorTableBytes); 376 | } 377 | 378 | // One time initialization of imageData before first frame 379 | if (keyFrame) { 380 | if (transparentColorIndex == NO_TRANSPARENT_INDEX) { 381 | fillImageData(lsdBackgroundIndex); 382 | } 383 | else { 384 | fillImageData(transparentColorIndex); 385 | } 386 | keyFrame = false; 387 | 388 | rectX = 0; 389 | rectY = 0; 390 | rectWidth = MATRIX_WIDTH; 391 | rectHeight = MATRIX_HEIGHT; 392 | } 393 | // Don't clear matrix screen for these disposal methods 394 | if ((prevDisposalMethod != DISPOSAL_NONE) && (prevDisposalMethod != DISPOSAL_LEAVE)) { 395 | //backgroundLayer.fillScreen({ 0, 0, 0 }); 396 | matrix->clear(); 397 | } 398 | 399 | // Process previous disposal method 400 | if (prevDisposalMethod == DISPOSAL_BACKGROUND) { 401 | // Fill portion of imageData with previous background color 402 | fillImageDataRect(prevBackgroundIndex, rectX, rectY, rectWidth, rectHeight); 403 | } 404 | else if (prevDisposalMethod == DISPOSAL_RESTORE) { 405 | copyImageDataRect(imageDataBU, imageData, rectX, rectY, rectWidth, rectHeight); 406 | } 407 | 408 | // Save disposal method for this frame for next time 409 | prevDisposalMethod = disposalMethod; 410 | 411 | if (disposalMethod != DISPOSAL_NONE) { 412 | // Save dimensions of this frame 413 | rectX = tbiImageX; 414 | rectY = tbiImageY; 415 | rectWidth = tbiWidth; 416 | rectHeight = tbiHeight; 417 | 418 | if (disposalMethod == DISPOSAL_BACKGROUND) { 419 | if (transparentColorIndex != NO_TRANSPARENT_INDEX) { 420 | prevBackgroundIndex = transparentColorIndex; 421 | } 422 | else { 423 | prevBackgroundIndex = lsdBackgroundIndex; 424 | } 425 | } 426 | else if (disposalMethod == DISPOSAL_RESTORE) { 427 | copyImageDataRect(imageData, imageDataBU, rectX, rectY, rectWidth, rectHeight); 428 | } 429 | } 430 | 431 | // Read the min LZW code size 432 | lzwCodeSize = readByte(); 433 | 434 | #if DEBUG == 1 435 | Serial.print(F("LzwCodeSize: ")); 436 | Serial.println(lzwCodeSize); 437 | #endif 438 | 439 | // Gather the lzw image data 440 | // NOTE: the dataBlockSize byte is left in the data as the lzw decoder needs it 441 | int offset = 0; 442 | int dataBlockSize = readByte(); 443 | while (dataBlockSize != 0) { 444 | #if DEBUG == 1 445 | Serial.print(F("dataBlockSize: ")); 446 | Serial.println(dataBlockSize); 447 | #endif 448 | backUpStream(1); 449 | dataBlockSize++; 450 | // quick fix to prevent a crash if lzwImageData is not large enough 451 | if (offset + dataBlockSize <= (int) sizeof(lzwImageData)) { 452 | readIntoBuffer(lzwImageData + offset, dataBlockSize); 453 | } 454 | else { 455 | int i; 456 | // discard the data block that would cause a buffer overflow 457 | for (i = 0; i < dataBlockSize; i++) 458 | file.read(); 459 | #if DEBUG == 1 460 | Serial.print(F("******* Prevented lzwImageData Overflow ******")); 461 | #endif 462 | } 463 | 464 | offset += dataBlockSize; 465 | dataBlockSize = readByte(); 466 | } 467 | 468 | #if DEBUG == 1 469 | Serial.print(F("total lzwImageData Size: ")); 470 | Serial.println(offset); 471 | #endif 472 | 473 | // Process the animation frame for display 474 | 475 | // Initialize the LZW decoder for this frame 476 | lzw_decode_init(lzwCodeSize, lzwImageData); 477 | 478 | // Decompress LZW data and display the frame 479 | decompressAndDisplayFrame(); 480 | 481 | // Graphic control extension is for a single frame 482 | // Remove its influence 483 | transparentColorIndex = NO_TRANSPARENT_INDEX; 484 | disposalMethod = DISPOSAL_NONE; 485 | 486 | // Make sure there is at least some delay between frames 487 | if (frameDelay < 1) { 488 | frameDelay = 1; 489 | } 490 | 491 | // delay(frameDelay * 10); 492 | return frameDelay * 10; 493 | } 494 | // parseTableBasedImage 495 | 496 | // LZW constants 497 | // NOTE: LZW_MAXBITS set to 11 to support more GIFs with 6k RAM increase (initially 10 to save memory) 498 | #define LZW_MAXBITS 11 499 | #define LZW_SIZTABLE (1 << LZW_MAXBITS) 500 | 501 | // Masks for 0 .. 16 bits 502 | unsigned int mask[17] = { 503 | 0x0000, 0x0001, 0x0003, 0x0007, 504 | 0x000F, 0x001F, 0x003F, 0x007F, 505 | 0x00FF, 0x01FF, 0x03FF, 0x07FF, 506 | 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 507 | 0xFFFF 508 | }; 509 | 510 | // LZW variables 511 | byte *pbuf; 512 | int bbits; 513 | int bbuf; 514 | int cursize; // The current code size 515 | int curmask; 516 | int codesize; 517 | int clear_code; 518 | int end_code; 519 | int newcodes; // First available code 520 | int top_slot; // Highest code for current size 521 | int extra_slot; 522 | int slot; // Last read code 523 | int fc, oc; 524 | int bs; // Current buffer size for GIF 525 | byte *sp; 526 | byte stack[LZW_SIZTABLE]; 527 | byte suffix[LZW_SIZTABLE]; 528 | unsigned int prefix[LZW_SIZTABLE]; 529 | 530 | // Initialize LZW decoder 531 | // csize initial code size in bits 532 | // buf input data 533 | void lzw_decode_init(int csize, byte *buf) { 534 | 535 | // Initialize read buffer variables 536 | pbuf = buf; 537 | bbuf = 0; 538 | bbits = 0; 539 | bs = 0; 540 | 541 | // Initialize decoder variables 542 | codesize = csize; 543 | cursize = codesize + 1; 544 | curmask = mask[cursize]; 545 | top_slot = 1 << cursize; 546 | clear_code = 1 << codesize; 547 | end_code = clear_code + 1; 548 | slot = newcodes = clear_code + 2; 549 | oc = fc = -1; 550 | sp = stack; 551 | } 552 | 553 | // Get one code of given number of bits from stream 554 | int lzw_get_code() { 555 | 556 | while (bbits < cursize) { 557 | if (!bs) { 558 | bs = *pbuf++; 559 | } 560 | bbuf |= (*pbuf++) << bbits; 561 | bbits += 8; 562 | bs--; 563 | } 564 | int c = bbuf; 565 | bbuf >>= cursize; 566 | bbits -= cursize; 567 | return c & curmask; 568 | } 569 | 570 | // Decode given number of bytes 571 | // buf 8 bit output buffer 572 | // len number of pixels to decode 573 | // returns the number of bytes decoded 574 | int lzw_decode(byte *buf, int len) { 575 | int l, c, code; 576 | 577 | if (end_code < 0) { 578 | return 0; 579 | } 580 | l = len; 581 | 582 | for (;;) { 583 | while (sp > stack) { 584 | *buf++ = *(--sp); 585 | if ((--l) == 0) { 586 | goto the_end; 587 | } 588 | } 589 | c = lzw_get_code(); 590 | if (c == end_code) { 591 | break; 592 | 593 | } 594 | else if (c == clear_code) { 595 | cursize = codesize + 1; 596 | curmask = mask[cursize]; 597 | slot = newcodes; 598 | top_slot = 1 << cursize; 599 | fc = oc = -1; 600 | 601 | } 602 | else { 603 | 604 | code = c; 605 | if ((code == slot) && (fc >= 0)) { 606 | *sp++ = fc; 607 | code = oc; 608 | } 609 | else if (code >= slot) { 610 | break; 611 | } 612 | while (code >= newcodes) { 613 | *sp++ = suffix[code]; 614 | code = prefix[code]; 615 | } 616 | *sp++ = code; 617 | if ((slot < top_slot) && (oc >= 0)) { 618 | suffix[slot] = code; 619 | prefix[slot++] = oc; 620 | } 621 | fc = code; 622 | oc = c; 623 | if (slot >= top_slot) { 624 | if (cursize < LZW_MAXBITS) { 625 | top_slot <<= 1; 626 | curmask = mask[++cursize]; 627 | } 628 | else { 629 | #if DEBUG == 1 630 | Serial.println(F("****** cursize >= MAXBITS *******")); 631 | #endif 632 | } 633 | } 634 | } 635 | } 636 | end_code = -1; 637 | the_end: 638 | return len - l; 639 | } 640 | // lzw_decode 641 | 642 | // Decompress LZW data and display animation frame 643 | void decompressAndDisplayFrame() { 644 | 645 | // Each pixel of image is 8 bits and is an index into the palette 646 | 647 | // How the image is decoded depends upon whether it is interlaced or not 648 | // Decode the interlaced LZW data into the image buffer 649 | if (tbiInterlaced) { 650 | // Decode every 8th line starting at line 0 651 | for (int line = tbiImageY + 0; line < tbiHeight + tbiImageY; line += 8) { 652 | lzw_decode(imageData + (line * MATRIX_WIDTH) + tbiImageX, tbiWidth); 653 | } 654 | // Decode every 8th line starting at line 4 655 | for (int line = tbiImageY + 4; line < tbiHeight + tbiImageY; line += 8) { 656 | lzw_decode(imageData + (line * MATRIX_WIDTH) + tbiImageX, tbiWidth); 657 | } 658 | // Decode every 4th line starting at line 2 659 | for (int line = tbiImageY + 2; line < tbiHeight + tbiImageY; line += 4) { 660 | lzw_decode(imageData + (line * MATRIX_WIDTH) + tbiImageX, tbiWidth); 661 | } 662 | // Decode every 2nd line starting at line 1 663 | for (int line = tbiImageY + 1; line < tbiHeight + tbiImageY; line += 2) { 664 | lzw_decode(imageData + (line * MATRIX_WIDTH) + tbiImageX, tbiWidth); 665 | } 666 | } 667 | else { 668 | // Decode the non interlaced LZW data into the image data buffer 669 | for (int line = tbiImageY; line < tbiHeight + tbiImageY; line++) { 670 | lzw_decode(imageData + (line * MATRIX_WIDTH) + tbiImageX, tbiWidth); 671 | } 672 | } 673 | 674 | // Image data is decompressed, now display portion of image affected by frame 675 | 676 | CRGB color; 677 | int yOffset, pixel; 678 | for (int y = tbiImageY; y < tbiHeight + tbiImageY; y++) { 679 | yOffset = y * MATRIX_WIDTH; 680 | for (int x = tbiImageX; x < tbiWidth + tbiImageX; x++) { 681 | // Get the next pixel 682 | pixel = imageData[yOffset + x]; 683 | 684 | // Check pixel transparency 685 | if (pixel == transparentColorIndex) { 686 | continue; 687 | } 688 | 689 | // Pixel not transparent so get color from palette 690 | color.red = gifPalette[pixel].Red; 691 | color.green = gifPalette[pixel].Green; 692 | color.blue = gifPalette[pixel].Blue; 693 | 694 | // Draw the pixel 695 | //backgroundLayer.drawPixel(x, y, color); 696 | #if 0 697 | Serial.print(x); 698 | Serial.print(" "); 699 | Serial.print(y); 700 | Serial.print(" > "); 701 | Serial.println(color.r*65536+color.g*256+color.b, HEX); 702 | 703 | #endif 704 | matrix->setPassThruColor(color.r*65536+color.g*256+color.b); 705 | matrix->drawPixel(x, y, color); 706 | matrix->setPassThruColor(); 707 | //matrixleds[XY(x,y)] = color; 708 | } 709 | } 710 | //// Make animation frame visible 711 | //backgroundLayer.swapBuffers(); 712 | } 713 | 714 | public: 715 | void setFile(File imageFile) { 716 | file = imageFile; 717 | } 718 | 719 | // Make sure the file is a Gif file 720 | boolean parseGifHeader() { 721 | 722 | char buffer[10]; 723 | 724 | readIntoBuffer(buffer, GIFHDRSIZE); 725 | 726 | if ((strncmp(buffer, GIFHDRTAGNORM, GIFHDRSIZE) != 0) && 727 | (strncmp(buffer, GIFHDRTAGNORM1, GIFHDRSIZE) != 0)) { 728 | return false; 729 | } 730 | else { 731 | return true; 732 | } 733 | } 734 | 735 | // Parse the logical screen descriptor 736 | void parseLogicalScreenDescriptor() { 737 | 738 | lsdWidth = readWord(); 739 | lsdHeight = readWord(); 740 | lsdPackedField = readByte(); 741 | lsdBackgroundIndex = readByte(); 742 | lsdAspectRatio = readByte(); 743 | 744 | #if DEBUG == 1 745 | Serial.print(F("lsdWidth: ")); 746 | Serial.println(lsdWidth); 747 | Serial.print(F("lsdHeight: ")); 748 | Serial.println(lsdHeight); 749 | Serial.print(F("lsdPackedField: ")); 750 | Serial.println(lsdPackedField, HEX); 751 | Serial.print(F("lsdBackgroundIndex: ")); 752 | Serial.println(lsdBackgroundIndex); 753 | Serial.print(F("lsdAspectRatio: ")); 754 | Serial.println(lsdAspectRatio); 755 | #endif 756 | } 757 | 758 | // Parse the global color table 759 | void parseGlobalColorTable() { 760 | 761 | // Does a global color table exist? 762 | if (lsdPackedField & COLORTBLFLAG) { 763 | 764 | // A GCT was present determine how many colors it contains 765 | colorCount = 1 << ((lsdPackedField & 7) + 1); 766 | 767 | #if DEBUG == 1 768 | Serial.print(F("Global color table with ")); 769 | Serial.print(colorCount); 770 | Serial.println(F(" colors present")); 771 | #endif 772 | // Read color values into the palette array 773 | int colorTableBytes = sizeof(_RGB) * colorCount; 774 | readIntoBuffer(gifPalette, colorTableBytes); 775 | } 776 | } 777 | 778 | unsigned long drawFrame() { 779 | 780 | #if DEBUG == 1 781 | Serial.println(F("\nParsing Data Block")); 782 | #endif 783 | 784 | boolean done = false; 785 | while (!done) { 786 | 787 | #if 0 && DEBUG == 1 788 | Serial.println(F("\nPress Key For Next")); 789 | while (Serial.read() <= 0); 790 | #endif 791 | 792 | // Determine what kind of data to process 793 | byte b = readByte(); 794 | 795 | if (b == 0x2c) { 796 | // Parse table based image 797 | #if DEBUG == 1 798 | Serial.println(F("\nParsing Table Based")); 799 | #endif 800 | unsigned int fdelay = parseTableBasedImage(); 801 | return fdelay; 802 | } 803 | else if (b == 0x21) { 804 | // Parse extension 805 | b = readByte(); 806 | 807 | // Determine which kind of extension to parse 808 | switch (b) { 809 | case 0x01: 810 | // Plain test extension 811 | parsePlainTextExtension(); 812 | break; 813 | case 0xf9: 814 | // Graphic control extension 815 | parseGraphicControlExtension(); 816 | break; 817 | case 0xfe: 818 | // Comment extension 819 | parseCommentExtension(); 820 | break; 821 | case 0xff: 822 | // Application extension 823 | parseApplicationExtension(); 824 | break; 825 | default: 826 | #if DEBUG == 1 827 | Serial.print(F("Unknown control extension: ")); 828 | Serial.println(b, HEX); 829 | #endif 830 | return ERROR_UNKNOWNCONTROLEXT; 831 | } 832 | } 833 | else { 834 | #if DEBUG == 1 835 | Serial.println(F("\nParsing Done")); 836 | #endif 837 | done = true; 838 | 839 | // Push unprocessed byte back into the stream for later processing 840 | backUpStream(1); 841 | 842 | return ERROR_FINISHED; 843 | } 844 | } 845 | return ERROR_NONE; 846 | } 847 | }; 848 | 849 | #endif 850 | -------------------------------------------------------------------------------- /examples/espgifread/README.md: -------------------------------------------------------------------------------- 1 | AnimatedGIFs replacement 2 | ------------------------ 3 | Please go to 4 | - http://marc.merlins.org/perso/arduino/post_2018-07-13_AnimatedGIFs-for-SmartMatrix-or-NeoMatrix-_Neopixel-WS2812B_-from-SDcard-or-SPIFFS_-on-Teensy-3_x_-ESP8266_-or-ESP32.html 5 | - https://github.com/marcmerlin/AnimatedGIFs 6 | 7 | for a better/newer version of this code. 8 | 9 | You may however like this version if you really want a bare bones gif decoder. 10 | 11 | 12 | Original Text 13 | ------------- 14 | Demo to display gifs read from SPIFFS from ESP8266 (should also work on ESP32). 15 | 16 | Decoding engine from Jason Coon, Aurora. 17 | https://github.com/pixelmatix/aurora/ 18 | 19 | The gifs need to be uploaded to the ESP8266's SPIFFS. You can do this within the Arduino IDE after installing the [Arduino ESP8266FS tool](http://esp8266.github.io/Arduino/versions/2.3.0/doc/filesystem.html#uploading-files-to-file-system). 20 | 21 | With ESP8266FS installed upload the web app using `ESP8266 Sketch Data Upload` command in the Arduino Tools menu. 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/espgifread/config.h: -------------------------------------------------------------------------------- 1 | #ifndef config_h 2 | #define config_h 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | //---------------------------------------------------------------------------- 9 | // 10 | // Used by LEDMatrix 11 | #define MATRIX_TILE_WIDTH 8 // width of EACH NEOPIXEL MATRIX (not total display) 12 | #define MATRIX_TILE_HEIGHT 32 // height of each matrix 13 | #define MATRIX_TILE_H 3 // number of matrices arranged horizontally 14 | #define MATRIX_TILE_V 1 // number of matrices arranged vertically 15 | 16 | // Used by NeoMatrix 17 | #define mw (MATRIX_TILE_WIDTH * MATRIX_TILE_H) 18 | #define mh (MATRIX_TILE_HEIGHT * MATRIX_TILE_V) 19 | #define NUMMATRIX (mw*mh) 20 | 21 | // Compat for some other demos 22 | #define NUM_LEDS NUMMATRIX 23 | #define MATRIX_HEIGHT mh 24 | #define MATRIX_WIDTH mw 25 | 26 | CRGB matrixleds[NUMMATRIX]; 27 | 28 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(matrixleds, MATRIX_TILE_WIDTH, MATRIX_TILE_HEIGHT, MATRIX_TILE_H, MATRIX_TILE_V, 29 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 30 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG + 31 | NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_PROGRESSIVE); 32 | 33 | uint8_t matrix_brightness = 32; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /examples/espgifread/data/gifs/32anim_balls.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcmerlin/FastLED_NeoMatrix/40fb822377497a7be8e1103be344104870ff0878/examples/espgifread/data/gifs/32anim_balls.gif -------------------------------------------------------------------------------- /examples/espgifread/data/gifs/32anim_dance.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcmerlin/FastLED_NeoMatrix/40fb822377497a7be8e1103be344104870ff0878/examples/espgifread/data/gifs/32anim_dance.gif -------------------------------------------------------------------------------- /examples/espgifread/data/gifs/32anim_flower.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcmerlin/FastLED_NeoMatrix/40fb822377497a7be8e1103be344104870ff0878/examples/espgifread/data/gifs/32anim_flower.gif -------------------------------------------------------------------------------- /examples/espgifread/data/gifs/32anim_photon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcmerlin/FastLED_NeoMatrix/40fb822377497a7be8e1103be344104870ff0878/examples/espgifread/data/gifs/32anim_photon.gif -------------------------------------------------------------------------------- /examples/espgifread/espgifread.ino: -------------------------------------------------------------------------------- 1 | // http://esp8266.github.io/Arduino/versions/2.3.0/doc/filesystem.html#uploading-files-to-file-system 2 | // esp8266com/esp8266/libraries/SD/src/File.cpp 3 | #include 4 | 5 | #include "config.h" 6 | 7 | #include "GifPlayer.h" 8 | GifPlayer gifPlayer; 9 | 10 | #if defined(ESP8266) 11 | extern "C" { 12 | #include "user_interface.h" 13 | } 14 | #else 15 | #error "This code uses SPIFFS on ESP8266 chips, for a version compatible with ESP32, see https://github.com/marcmerlin/AnimatedGifs" 16 | #endif 17 | 18 | 19 | void display_resolution() { 20 | matrix->setTextSize(1); 21 | // not wide enough; 22 | if (mw<16) return; 23 | matrix->clear(); 24 | // Font is 5x7, if display is too small 25 | // 8 can only display 1 char 26 | // 16 can almost display 3 chars 27 | // 24 can display 4 chars 28 | // 32 can display 5 chars 29 | matrix->setCursor(0, 0); 30 | matrix->setTextColor(matrix->Color(255,0,0)); 31 | if (mw>10) matrix->print(mw/10); 32 | matrix->setTextColor(matrix->Color(255,128,0)); 33 | matrix->print(mw % 10); 34 | matrix->setTextColor(matrix->Color(0,255,0)); 35 | matrix->print('x'); 36 | // not wide enough to print 5 chars, go to next line 37 | if (mw<25) { 38 | if (mh==13) matrix->setCursor(6, 7); 39 | else if (mh>=13) { 40 | matrix->setCursor(mw-12, 8); 41 | } else { 42 | // we're not tall enough either, so we wait and display 43 | // the 2nd value on top. 44 | matrix->show(); 45 | matrix->clear(); 46 | matrix->setCursor(mw-11, 0); 47 | } 48 | } 49 | matrix->setTextColor(matrix->Color(0,255,128)); 50 | matrix->print(mh/10); 51 | matrix->setTextColor(matrix->Color(0,128,255)); 52 | matrix->print(mh % 10); 53 | // enough room for a 2nd line 54 | if ((mw>25 && mh >14) || mh>16) { 55 | matrix->setCursor(0, mh-7); 56 | matrix->setTextColor(matrix->Color(0,255,255)); 57 | if (mw>16) matrix->print('*'); 58 | matrix->setTextColor(matrix->Color(255,0,0)); 59 | matrix->print('R'); 60 | matrix->setTextColor(matrix->Color(0,255,0)); 61 | matrix->print('G'); 62 | matrix->setTextColor(matrix->Color(0,0,255)); 63 | matrix->print("B"); 64 | matrix->setTextColor(matrix->Color(255,255,0)); 65 | // this one could be displayed off screen, but we don't care :) 66 | matrix->print("*"); 67 | } 68 | 69 | matrix->show(); 70 | } 71 | 72 | 73 | void loop() { 74 | Dir dir = SPIFFS.openDir("/"); 75 | while (dir.next()) { 76 | uint32_t result; 77 | 78 | String fileName = dir.fileName(); 79 | //fileName = "/gifs/32anim_balls.gif"; 80 | //fileName = "/gifs/32anim_dance.gif"; 81 | //fileName = "/gifs/32anim_flower.gif"; 82 | //fileName = "/gifs/32anim_photon.gif"; 83 | 84 | Serial.print("Reading "); 85 | Serial.println(fileName); 86 | 87 | File imageFile = SPIFFS.open(fileName, "r"); 88 | if (!imageFile) { 89 | Serial.println("Failed to open"); 90 | return; 91 | } 92 | 93 | gifPlayer.setFile(imageFile); 94 | 95 | for (uint8_t c=0; c<10; c++) { 96 | if (!gifPlayer.parseGifHeader()) { 97 | imageFile.close(); 98 | Serial.println("No gif header"); 99 | return; 100 | } 101 | 102 | matrix->clear(); 103 | gifPlayer.parseLogicalScreenDescriptor(); 104 | gifPlayer.parseGlobalColorTable(); 105 | Serial.println("Processing gif"); 106 | do { 107 | gifPlayer.drawFrame(); 108 | result = gifPlayer.drawFrame(); 109 | matrix->show(); 110 | delay(50); 111 | } while (result != ERROR_FINISHED); 112 | imageFile.seek(0); 113 | } 114 | 115 | Serial.println("Gif finished"); 116 | imageFile.close(); 117 | delay(1000); 118 | } 119 | } 120 | 121 | void setup() { 122 | Serial.begin(115200); 123 | 124 | #ifdef ESP8266 125 | Serial.println(); 126 | Serial.print( F("Heap: ") ); Serial.println(system_get_free_heap_size()); 127 | Serial.print( F("Boot Vers: ") ); Serial.println(system_get_boot_version()); 128 | Serial.print( F("CPU: ") ); Serial.println(system_get_cpu_freq()); 129 | Serial.print( F("SDK: ") ); Serial.println(system_get_sdk_version()); 130 | Serial.print( F("Chip ID: ") ); Serial.println(system_get_chip_id()); 131 | Serial.print( F("Flash ID: ") ); Serial.println(spi_flash_get_id()); 132 | Serial.print( F("Flash Size: ") ); Serial.println(ESP.getFlashChipRealSize()); 133 | Serial.print( F("Vcc: ") ); Serial.println(ESP.getVcc()); 134 | Serial.println(); 135 | #endif 136 | 137 | SPIFFS.begin(); 138 | { 139 | Dir dir = SPIFFS.openDir("/"); 140 | while (dir.next()) { 141 | String fileName = dir.fileName(); 142 | size_t fileSize = dir.fileSize(); 143 | Serial.printf("FS File: %s, size: %s\n", fileName.c_str(), String(fileSize).c_str()); 144 | } 145 | Serial.printf("\n"); 146 | } 147 | 148 | FastLED.addLeds(matrixleds, NUMMATRIX/3).setCorrection(TypicalLEDStrip); 149 | matrix->begin(); 150 | matrix->setBrightness(matrix_brightness); 151 | display_resolution(); 152 | } 153 | 154 | // vim:sts=4:sw=4 155 | -------------------------------------------------------------------------------- /examples/fontzoom/README.md: -------------------------------------------------------------------------------- 1 | Demo Videos: 2 | - https://youtu.be/NRKLB8YhJ6Y 3 | - https://youtu.be/bPLuH3Ln9gU 4 | -------------------------------------------------------------------------------- /examples/fontzoom/fontzoom.ino: -------------------------------------------------------------------------------- 1 | // By Marc MERLIN 2 | // License: Apache v2.0 3 | // 4 | 5 | #include 6 | #include 7 | #include 8 | #include "fonts.h" 9 | 10 | #define MATRIXPIN D6 11 | 12 | #define MATRIX_TILE_WIDTH 8 // width of EACH NEOPIXEL MATRIX (not total display) 13 | #define MATRIX_TILE_HEIGHT 32 // height of each matrix 14 | #define MATRIX_TILE_H 3 // number of matrices arranged horizontally 15 | #define MATRIX_TILE_V 1 // number of matrices arranged vertically 16 | 17 | // Used by NeoMatrix 18 | #define mw (MATRIX_TILE_WIDTH * MATRIX_TILE_H) 19 | #define mh (MATRIX_TILE_HEIGHT * MATRIX_TILE_V) 20 | #define NUMMATRIX (mw*mh) 21 | 22 | uint8_t matrix_brightness = 32; 23 | 24 | CRGB matrixleds[NUMMATRIX]; 25 | 26 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(matrixleds, MATRIX_TILE_WIDTH, MATRIX_TILE_HEIGHT, MATRIX_TILE_H, MATRIX_TILE_V, 27 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 28 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG + 29 | NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_PROGRESSIVE); 30 | 31 | bool matrix_reset_demo = 1; 32 | int8_t matrix_loop = -1; 33 | 34 | // --------------------------------------------------------------------------- 35 | // Shared functions 36 | // --------------------------------------------------------------------------- 37 | 38 | uint16_t Color24toColor16(uint32_t color) { 39 | return ((uint16_t)(((color & 0xFF0000) >> 16) & 0xF8) << 8) | 40 | ((uint16_t)(((color & 0x00FF00) >> 8) & 0xFC) << 3) | 41 | (((color & 0x0000FF) >> 0) >> 3); 42 | } 43 | 44 | // Input a value 0 to 255 to get a color value. 45 | // The colours are a transition r - g - b - back to r. 46 | uint32_t Wheel(byte WheelPos) { 47 | uint32_t wheel=0; 48 | 49 | // Serial.print(WheelPos); 50 | WheelPos = 255 - WheelPos; 51 | if (WheelPos < 85) { 52 | wheel = (((uint32_t)(255 - WheelPos * 3)) << 16) + (WheelPos * 3); 53 | } 54 | if (!wheel && WheelPos < 170) { 55 | WheelPos -= 85; 56 | wheel = (((uint32_t)(WheelPos * 3)) << 8) + (255 - WheelPos * 3); 57 | } 58 | if (!wheel) { 59 | WheelPos -= 170; 60 | wheel = (((uint32_t)(WheelPos * 3)) << 16) + (((uint32_t)(255 - WheelPos * 3)) << 8); 61 | } 62 | // Serial.print(" -> "); 63 | // Serial.println(wheel, HEX); 64 | return (wheel); 65 | } 66 | 67 | // --------------------------------------------------------------------------- 68 | // Matrix Code 69 | // --------------------------------------------------------------------------- 70 | 71 | // type 0 = up, type 1 = up and down 72 | // The code is complicated looking, but the state machine is so that 73 | // you can call this function to do a frame update and then switch to 74 | // other work 75 | // There are some magic numbers I had to hand tune for a 24x32 array. 76 | // You'll have to adjust for your own array size 77 | uint8_t font_zoom(uint8_t zoom_type, uint8_t speed) { 78 | static uint16_t state; 79 | static uint16_t direction; 80 | static uint16_t size; 81 | static uint8_t l; 82 | static int16_t faster = 0; 83 | static bool dont_exit; 84 | static uint16_t delayframe; 85 | char letters[] = { 'H', 'E', 'L', 'l', 'O' }; 86 | bool done = 0; 87 | uint8_t repeat = 3; 88 | 89 | if (matrix_reset_demo == 1) { 90 | matrix_reset_demo = 0; 91 | state = 1; 92 | direction = 1; 93 | size = 3; 94 | l = 0; 95 | if (matrix_loop == -1) { dont_exit = 1; delayframe = 2; faster = 0; }; 96 | } 97 | 98 | matrix->setTextSize(1); 99 | 100 | if (--delayframe) { 101 | // reset how long a frame is shown before we switch to the next one 102 | // Serial.println("delayed frame"); 103 | matrix->show(); // make sure we still run at the same speed. 104 | return repeat; 105 | } 106 | delayframe = max((speed / 10) - faster , 1); 107 | // before exiting, we run the full delay to show the last frame long enough 108 | if (dont_exit == 0) { dont_exit = 1; return 0; } 109 | if (direction == 1) { 110 | int8_t offset = 0; // adjust some letters left or right as needed 111 | if (letters[l] == 'H') offset = -3 * size/15; 112 | if (letters[l] == 'O') offset = -3 * size/15; 113 | if (letters[l] == 'l') offset = +5 * size/15; 114 | 115 | uint16_t txtcolor = Color24toColor16(Wheel(map(letters[l], '0', 'Z', 0, 255))); 116 | matrix->setTextColor(txtcolor); 117 | 118 | matrix->clear(); 119 | matrix->setFont( &Century_Schoolbook_L_Bold[size] ); 120 | matrix->setCursor(10-size*0.55+offset, 17+size*0.75); 121 | matrix->print(letters[l]); 122 | if (size<18) size++; 123 | else if (zoom_type == 0) { done = 1; delayframe = max((speed - faster*10) * 1, 3); } 124 | else direction = 2; 125 | 126 | } else if (zoom_type == 1) { 127 | int8_t offset = 0; // adjust some letters left or right as needed 128 | uint16_t txtcolor = Color24toColor16(Wheel(map(letters[l], '0', 'Z', 255, 0))); 129 | if (letters[l] == 'H') offset = -3 * size/15; 130 | if (letters[l] == 'O') offset = -3 * size/15; 131 | if (letters[l] == 'l') offset = +5 * size/15; 132 | 133 | matrix->setTextColor(txtcolor); 134 | matrix->clear(); 135 | matrix->setFont( &Century_Schoolbook_L_Bold[size] ); 136 | matrix->setCursor(10-size*0.55+offset, 17+size*0.75); 137 | matrix->print(letters[l]); 138 | if (size>3) size--; else { done = 1; direction = 1; delayframe = max((speed-faster*10)/2, 3); }; 139 | } 140 | 141 | matrix->show(); 142 | //Serial.println("done?"); 143 | if (! done) return repeat; 144 | direction = 1; 145 | size = 3; 146 | //Serial.println("more letters?"); 147 | if (++l < sizeof(letters)) return repeat; 148 | l = 0; 149 | //Serial.println("reverse pattern?"); 150 | if (zoom_type == 1 && direction == 2) return repeat; 151 | 152 | //Serial.println("Done with font animation"); 153 | faster++; 154 | matrix_reset_demo = 1; 155 | dont_exit = 0; 156 | // Serial.print("delayframe on last letter "); 157 | // Serial.println(delayframe); 158 | // After showing the last letter, pause longer 159 | // unless it's a zoom in zoom out. 160 | if (zoom_type == 0) delayframe *= 5; else delayframe *= 3; 161 | return repeat; 162 | } 163 | 164 | 165 | void loop() { 166 | uint8_t ret; 167 | static uint8_t cnt = 0; 168 | 169 | delay(5); 170 | // this code is meant to be run at some interval and keep its on 171 | // state while you do something else. 172 | 173 | if (cnt % 2) { 174 | ret = font_zoom(1, 25); 175 | } else { 176 | ret = font_zoom(0, 30); 177 | } 178 | if (matrix_loop == -1) matrix_loop = ret; 179 | if (ret) return; 180 | Serial.print("Finished run #"); 181 | Serial.println(matrix_loop); 182 | if (matrix_loop-- > 0) return; 183 | Serial.println("Animation loop done, switching to other demo"); 184 | cnt++; 185 | //delay(1000); 186 | matrix_reset_demo = 1; 187 | } 188 | 189 | 190 | void setup() { 191 | delay(1000); 192 | Serial.begin(115200); 193 | 194 | // Init Matrix 195 | // Serialized, 768 pixels takes 26 seconds for 1000 updates or 26ms per refresh 196 | // FastLED.addLeds(matrixleds, NUMMATRIX).setCorrection(TypicalLEDStrip); 197 | // https://github.com/FastLED/FastLED/wiki/Parallel-Output 198 | // WS2811_PORTA - pins 12, 13, 14 and 15 or pins 6,7,5 and 8 on the NodeMCU 199 | // This is much faster 1000 updates in 10sec 200 | //FastLED.addLeds(leds, NUMMATRIX); 201 | FastLED.addLeds(matrixleds, NUMMATRIX/3).setCorrection(TypicalLEDStrip); 202 | Serial.print("Matrix Size: "); 203 | Serial.print(mw); 204 | Serial.print(" "); 205 | Serial.println(mh); 206 | matrix->begin(); 207 | matrix->setBrightness(matrix_brightness); 208 | matrix->setTextWrap(false); 209 | } 210 | 211 | // vim:sts=4:sw=4 212 | -------------------------------------------------------------------------------- /examples/matrixtest/matrixtest.pde: -------------------------------------------------------------------------------- 1 | // Adafruit_NeoMatrix example for single NeoPixel Shield. 2 | // Scrolls 'Howdy' across the matrix in a portrait (vertical) orientation. 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define PIN 6 9 | 10 | // MATRIX DECLARATION: 11 | // Parameter 1 = width of NeoPixel matrix 12 | // Parameter 2 = height of matrix 13 | // Parameter 3 = pin number (most are valid) 14 | // Parameter 4 = matrix layout flags, add together as needed: 15 | // NEO_MATRIX_TOP, NEO_MATRIX_BOTTOM, NEO_MATRIX_LEFT, NEO_MATRIX_RIGHT: 16 | // Position of the FIRST LED in the matrix; pick two, e.g. 17 | // NEO_MATRIX_TOP + NEO_MATRIX_LEFT for the top-left corner. 18 | // NEO_MATRIX_ROWS, NEO_MATRIX_COLUMNS: LEDs are arranged in horizontal 19 | // rows or in vertical columns, respectively; pick one or the other. 20 | // NEO_MATRIX_PROGRESSIVE, NEO_MATRIX_ZIGZAG: all rows/columns proceed 21 | // in the same order, or alternate lines reverse direction; pick one. 22 | // See example below for these values in action. 23 | // Parameter 5 = pixel type flags, add together as needed: 24 | // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 25 | // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 26 | // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 27 | // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 28 | 29 | 30 | // Example for NeoPixel Shield. In this application we'd like to use it 31 | // as a 5x8 tall matrix, with the USB port positioned at the top of the 32 | // Arduino. When held that way, the first pixel is at the top right, and 33 | // lines are arranged in columns, progressive order. The shield uses 34 | // 800 KHz (v2) pixels that expect GRB color data. 35 | #define mw 8 36 | #define mh 32 37 | #define NUMMATRIX (mw*mh) 38 | 39 | CRGB matrixleds[NUMMATRIX]; 40 | 41 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(matrixleds, mw, mh, mw/8, 1, 42 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 43 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG ); 44 | 45 | const uint16_t colors[] = { 46 | matrix->Color(255, 0, 0), matrix->Color(0, 255, 0), matrix->Color(0, 0, 255) }; 47 | 48 | void setup() { 49 | FastLED.addLeds(matrixleds, NUMMATRIX); 50 | matrix->begin(); 51 | matrix->setTextWrap(false); 52 | matrix->setBrightness(40); 53 | matrix->setTextColor(colors[0]); 54 | } 55 | 56 | int x = mw; 57 | int pass = 0; 58 | 59 | void loop() { 60 | matrix->fillScreen(0); 61 | matrix->setCursor(x, 0); 62 | matrix->print(F("Howdy")); 63 | if(--x < -36) { 64 | x = matrix->width(); 65 | if(++pass >= 3) pass = 0; 66 | matrix->setTextColor(colors[pass]); 67 | } 68 | matrix->show(); 69 | delay(100); 70 | } 71 | -------------------------------------------------------------------------------- /examples/tiletest/tiletest.pde: -------------------------------------------------------------------------------- 1 | // Adafruit_NeoMatrix example for tiled NeoPixel matrices. Scrolls 2 | // 'Howdy' across three 10x8 NeoPixel grids that were created using 3 | // NeoPixel 60 LEDs per meter flex strip. 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #define PIN 6 10 | 11 | // MATRIX DECLARATION: 12 | // Parameter 1 = width of EACH NEOPIXEL MATRIX (not total display) 13 | // Parameter 2 = height of each matrix 14 | // Parameter 3 = number of matrices arranged horizontally 15 | // Parameter 4 = number of matrices arranged vertically 16 | // Parameter 5 = pin number (most are valid) 17 | // Parameter 6 = matrix layout flags, add together as needed: 18 | // NEO_MATRIX_TOP, NEO_MATRIX_BOTTOM, NEO_MATRIX_LEFT, NEO_MATRIX_RIGHT: 19 | // Position of the FIRST LED in the FIRST MATRIX; pick two, e.g. 20 | // NEO_MATRIX_TOP + NEO_MATRIX_LEFT for the top-left corner. 21 | // NEO_MATRIX_ROWS, NEO_MATRIX_COLUMNS: LEDs WITHIN EACH MATRIX are 22 | // arranged in horizontal rows or in vertical columns, respectively; 23 | // pick one or the other. 24 | // NEO_MATRIX_PROGRESSIVE, NEO_MATRIX_ZIGZAG: all rows/columns WITHIN 25 | // EACH MATRIX proceed in the same order, or alternate lines reverse 26 | // direction; pick one. 27 | // NEO_TILE_TOP, NEO_TILE_BOTTOM, NEO_TILE_LEFT, NEO_TILE_RIGHT: 28 | // Position of the FIRST MATRIX (tile) in the OVERALL DISPLAY; pick 29 | // two, e.g. NEO_TILE_TOP + NEO_TILE_LEFT for the top-left corner. 30 | // NEO_TILE_ROWS, NEO_TILE_COLUMNS: the matrices in the OVERALL DISPLAY 31 | // are arranged in horizontal rows or in vertical columns, respectively; 32 | // pick one or the other. 33 | // NEO_TILE_PROGRESSIVE, NEO_TILE_ZIGZAG: the ROWS/COLUMS OF MATRICES 34 | // (tiles) in the OVERALL DISPLAY proceed in the same order for every 35 | // line, or alternate lines reverse direction; pick one. When using 36 | // zig-zag order, the orientation of the matrices in alternate rows 37 | // will be rotated 180 degrees (this is normal -- simplifies wiring). 38 | // See example below for these values in action. 39 | // Parameter 7 = pixel type flags, add together as needed: 40 | // NEO_RGB Pixels are wired for RGB bitstream (v1 pixels) 41 | // NEO_GRB Pixels are wired for GRB bitstream (v2 pixels) 42 | // NEO_KHZ400 400 KHz bitstream (e.g. FLORA v1 pixels) 43 | // NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip) 44 | 45 | // Example with three 10x8 matrices (created using NeoPixel flex strip -- 46 | // these grids are not a ready-made product). In this application we'd 47 | // like to arrange the three matrices side-by-side in a wide display. 48 | // The first matrix (tile) will be at the left, and the first pixel within 49 | // that matrix is at the top left. The matrices use zig-zag line ordering. 50 | // There's only one row here, so it doesn't matter if we declare it in row 51 | // or column order. The matrices use 800 KHz (v2) pixels that expect GRB 52 | // color data. 53 | #define mw 24 54 | #define mh 32 55 | #define NUMMATRIX (mw*mh) 56 | 57 | CRGB matrixleds[NUMMATRIX]; 58 | 59 | FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(matrixleds, 8, mh, mw/8, 1, 60 | NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + 61 | NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG + 62 | NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_PROGRESSIVE); 63 | 64 | const uint16_t colors[] = { 65 | matrix->Color(255, 0, 0), matrix->Color(0, 255, 0), matrix->Color(0, 0, 255) }; 66 | 67 | void setup() { 68 | //FastLED.addLeds(matrixleds, NUMMATRIX); 69 | FastLED.addLeds(matrixleds, NUMMATRIX/3).setCorrection(TypicalLEDStrip); 70 | matrix->begin(); 71 | matrix->setTextWrap(false); 72 | matrix->setBrightness(40); 73 | matrix->setTextColor(colors[0]); 74 | } 75 | 76 | int x = mw; 77 | int pass = 0; 78 | 79 | 80 | void loop() { 81 | matrix->fillScreen(0); 82 | matrix->setCursor(x, 0); 83 | matrix->print(F("Howdy")); 84 | if(--x < -36) { 85 | x = matrix->width(); 86 | if(++pass >= 3) pass = 0; 87 | matrix->setTextColor(colors[pass]); 88 | } 89 | matrix->show(); 90 | delay(100); 91 | } 92 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=FastLED NeoMatrix 2 | version=1.2 3 | author=Marc Merlin 4 | maintainer=Marc MERLIN 5 | sentence=Adafruit_GFX and FastLED compatible library for NeoPixel grids 6 | paragraph=This replaces https://github.com/adafruit/Adafruit_NeoMatrix for FastLED supported Pixels. 7 | category=Display 8 | url=https://github.com/marcmerlin/FastLED_NeoMatrix 9 | architectures=* 10 | depends=Framebuffer GFX 11 | --------------------------------------------------------------------------------