├── README.md ├── casio classwiz display traces.zip ├── include ├── Font.h ├── Keyboard.h ├── Keypad_MC17.h ├── Pages.h ├── README ├── Tetris.h ├── bitmap.h └── lcd.h ├── lib └── README ├── platformio.ini ├── src ├── Font_4x6.c ├── Font_5x7.c ├── Keypad_MC17.cpp ├── Tetris.cpp.off ├── bitmap.h ├── bitmaps.h ├── lcd.cpp ├── main.cpp ├── main.cpp.old └── snake.cpp └── test └── README /README.md: -------------------------------------------------------------------------------- 1 | # classwiz_lcd 2 | 3 | this is a proof of concept which interfaces with the lcd of a casio classwiz in order to show bitmaps. 4 | 5 | I know that this code is ugly af but hey, it works 6 | -------------------------------------------------------------------------------- /casio classwiz display traces.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DSchndr/classwiz_lcd/c181748f75bba632589b0d61567cd9a148dfbff8/casio classwiz display traces.zip -------------------------------------------------------------------------------- /include/Font.h: -------------------------------------------------------------------------------- 1 | #ifndef _FONT_H 2 | #define _FONT_H 3 | 4 | #include 5 | #include 6 | 7 | struct Font { 8 | const int width; 9 | const int height; 10 | const uint8_t** data; 11 | }; 12 | 13 | #endif -------------------------------------------------------------------------------- /include/Keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef KEYBOARD_H 2 | #define KEYBOARD_H 3 | 4 | 5 | #define K_UP 0x01 6 | #define K_DOWN 0x02 7 | #define K_RIGHT 0x03 8 | #define K_LEFT 0x04 9 | 10 | #define K_SHIFT 0x05 11 | #define K_ALPHA 0x06 12 | #define K_MODE 0x07 13 | 14 | #define K_OPTN 0x08 15 | #define K_CALC 0x09 16 | #define K_SUM 0x0A 17 | #define K_X 0x0B 18 | 19 | #define K_BRUCH 0x0C 20 | #define K_WURZEL 0x0D 21 | #define K_Xquad 0x0E 22 | #define K_Xhoch 0x0F 23 | #define K_LOG 0x10 24 | #define K_LN 0x11 25 | 26 | #define K_KLA_MIN 0x12 27 | #define K_ANF 0x13 28 | #define K_Xhmin1 0x14 29 | #define K_SIN 0x15 30 | #define K_COS 0x16 31 | #define K_TAN 0x17 32 | 33 | #define K_STO 0x18 34 | #define K_ENG 0x19 35 | #define K_SD 0x1A 36 | #define K_MP 0x1B 37 | 38 | #define K_DEL 0x1C 39 | #define K_AC 0x1D 40 | 41 | #define K_10hochx 0x1E 42 | #define K_ANS 0x1F 43 | 44 | 45 | #endif -------------------------------------------------------------------------------- /include/Keypad_MC17.h: -------------------------------------------------------------------------------- 1 | /* 2 | || 3 | || @file Keypad_MC17.h 4 | || @version 2.0 5 | || @author G. D. (Joe) Young 6 | || @contact "G. D. (Joe) Young" 7 | || 8 | || @description 9 | || | Keypad_MC17 provides an interface for using matrix keypads that 10 | || | are attached with Microchip MCP23017 I2C port expanders. It 11 | || | supports multiple keypads, user selectable pins, and user 12 | || | defined keymaps. 13 | || | The MCP23017 is somewhat similar to the MCP23016 which is supported 14 | || | by the earlier library Keypad_MC16. The difference most useful for 15 | || | use with Keypad is the provision of internal pullup resistors on the 16 | || | pins used as inputs, eliminating the need to provide 16 external 17 | || | resistors. The 23017 also has more comprehensive support for separate 18 | || | 8-bit ports instead of a single 16-bit port. However, this library 19 | || | assumes configuration as 16-bit port--IOCON.BANK = 0. 20 | || # 21 | || 22 | || @version 2.0 - April 5, 2020 23 | || | MKRZERO, ESP32 compile error from inheriting TwoWire that was OK with 24 | || | original ATMEGA boards; possibly because newer processors can have 25 | || | multiple I2C WireX ports. Consequently, added the ability to specify 26 | || | an alternate Wire as optional parameter in constructor. 27 | || # 28 | || 29 | || @license 30 | || | This library is free software; you can redistribute it and/or 31 | || | modify it under the terms of the GNU Lesser General Public 32 | || | License as published by the Free Software Foundation; version 33 | || | 2.1 of the License or any later version. 34 | || | 35 | || | This library is distributed in the hope that it will be useful, 36 | || | but WITHOUT ANY WARRANTY; without even the implied warranty of 37 | || | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 38 | || | Lesser General Public License for more details. 39 | || | 40 | || | You should have received a copy of the GNU Lesser General Public 41 | || | License along with this library; if not, see 42 | || | 43 | || # 44 | || 45 | */ 46 | 47 | #ifndef KEYPAD_MC17_H 48 | #define KEYPAD_MC17_H 49 | 50 | #include 51 | //#include "../Wire/Wire.h" 52 | #include 53 | 54 | class Keypad_MC17 : public Keypad { 55 | public: 56 | Keypad_MC17(char* userKeymap, byte* row, byte* col, byte numRows, byte numCols, byte address, TwoWire *_awire=&Wire ) : 57 | Keypad(userKeymap, row, col, numRows, numCols) { i2caddr = address; _wire=_awire; } 58 | 59 | // Keypad function 60 | void begin( char *userKeymap ); 61 | void begin( ); 62 | void end( ); 63 | 64 | 65 | // void beginnewwire( TwoWire * ); 66 | 67 | void pin_mode(byte pinNum, byte mode); 68 | void pin_write(byte pinNum, boolean level); 69 | int pin_read(byte pinNum); 70 | // read initial value for pinState 71 | word pinState_set( ); 72 | // write a whole word to i2c port 73 | void port_write( word i2cportval ); 74 | // access functions for IODIR state copy 75 | word iodir_read( ); 76 | void iodir_write( word iodir ); 77 | 78 | private: 79 | // I2C device address 80 | byte i2caddr; 81 | TwoWire *_wire; 82 | // I2C pin_write state persistant storage 83 | word pinState; 84 | // byte pin_iosetup( ); 85 | // MC17 setup 86 | word iodir_state; // copy of IODIR register 87 | void _begin( void ); 88 | }; 89 | 90 | 91 | #endif // KEYPAD_MC17_H 92 | 93 | /* 94 | || @changelog 95 | || | 96 | || | 2.0 2020-04-05 - Joe Young : MKRZERO compile error, Wire spec'd in Constructor 97 | || | 1.0 2014-05-18 - Joe Young : Convert from Keypad_MC16 98 | || # 99 | */ -------------------------------------------------------------------------------- /include/Pages.h: -------------------------------------------------------------------------------- 1 | #ifndef PAGES_H 2 | #define PAGES_H 3 | #include 4 | using namespace std; 5 | 6 | 7 | #define PAGECOUNT 2 8 | //10 lines max 9 | //******************************************** 10 | const char *Pages[PAGECOUNT] = { 11 | R"(Testpage 1 12 | This is the first Testpage)", 13 | R"(Testpage 2 14 | This is the second Testpage)", 15 | 16 | }; 17 | 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /include/Tetris.h: -------------------------------------------------------------------------------- 1 | #ifndef __TETRIS_H__ 2 | #define __TETRIS_H__ 3 | 4 | #include 5 | #include "../include/lcd.h" 6 | 7 | extern CasioLCD lcd; 8 | 9 | //extern void ttInitTimeouts(); 10 | //extern void ttSetTimeoutDelay( int ); 11 | //extern void ttTickTimeouts(); 12 | //extern void ttCallTimeouts(); 13 | //extern void ttGame(); 14 | //extern void ttStartGame(); 15 | 16 | #endif /* __TETRIS_H__ */ 17 | -------------------------------------------------------------------------------- /include/bitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef bitmap_h 2 | #define bitmap_h 3 | 4 | const unsigned char SPRITE_SNEK[8] = { 5 | 0b00000000, 6 | 0b10000100, 7 | 0b11001100, 8 | 0b10000100, 9 | 0b00000000, 10 | 0b01000100, 11 | 0b00111000, 12 | 0b00000000 13 | }; 14 | 15 | const unsigned char SPRITE_SNEK_BLOK[8]{ 16 | 0b00000000, 17 | 0b00111100, 18 | 0b11000011, 19 | 0b10000001, 20 | 0b10000001, 21 | 0b10000011, 22 | 0b01111100, 23 | 0b00000000 24 | }; 25 | 26 | const unsigned char SPRITE_SNEK_ASS[8] { 27 | 0b00000000, 28 | 0b00111100, 29 | 0b11000011, 30 | 0b10000001, 31 | 0b10000001, 32 | 0b10000011, 33 | 0b01111100, 34 | 0b00000000 35 | }; 36 | 37 | #endif -------------------------------------------------------------------------------- /include/lcd.h: -------------------------------------------------------------------------------- 1 | #ifndef lcd_h 2 | #define lcd_h 3 | 4 | #include 5 | #include "../include/Font.h" 6 | 7 | #define ON 12 8 | 9 | #define RESET 13 10 | #define DISPLAYEN 18 11 | #define CLOCK 14 12 | #define SHIFT 27 13 | #define MYST 26 14 | #define FIRST_LINE_MARKER 25 15 | 16 | //{2,15 ,4 ,16,19,23,32,33 17 | #define D0 2 18 | #define D1 15 19 | #define D2 4 20 | #define D3 16 21 | #define D4 19 22 | #define D5 23 23 | #define D6 32 24 | #define D7 33 25 | 26 | //#define LOW false 27 | //#define HIGH true 28 | 29 | //First line (0) is not getting drawn onto lcd 30 | //Second (1) is Icon bar (icon_pos is x position of icon) 31 | //Rest is dot matrix area 32 | 33 | /* 34 | X Position of Display icon 35 | ICONS ARE AT Y=1 36 | */ 37 | enum icon_pos { 38 | S = 7, 39 | A = 15, 40 | M = 23, 41 | X = 31, 42 | SQRT = 47, 43 | D = 55, 44 | R = 63, 45 | G = 71, 46 | FIX = 79, 47 | SCI = 87, 48 | E = 95, 49 | I = 103, 50 | DEG = 111, 51 | DOWN_CLEAR = 127, 52 | LEFT = 135, 53 | DOWN = 143, 54 | UP = 151, 55 | RIGHT = 159, 56 | PAUSE = 175, 57 | SUN = 183 58 | }; 59 | 60 | class CasioLCD { 61 | public: 62 | std::array, 192> framebuffer; 63 | CasioLCD(); 64 | void Writeframebuffer(); 65 | void setContrast(uint8_t contrast); 66 | void Init(); 67 | void ResetPosition(); 68 | void SetBus(uint8_t bus); 69 | void SetBus(int a, int b, int c, int d, int e, int f, int g, int h); 70 | void setReset(bool state); 71 | void TakeoverBus(); 72 | void BusTristate(); 73 | void Prepare(); 74 | void DrawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], 75 | int16_t w, int16_t h, bool color); 76 | void ClearFB(); 77 | void line(int x1, int y1, int x2, int y2); 78 | void lineLow(int x1, int y1, int x2, int y2); 79 | void lineHigh(int x1, int y1, int x2, int y2); 80 | void rect(int x, int y, int width, int height, bool _fill); 81 | void text(const char* str, int x, int y, bool color); 82 | void text(const char* str, int x, int y, bool color, bool onlyfirstline); 83 | void bitmap(const uint8_t* data, int x, int y, int width, int height, bool color); 84 | void textFont(const Font& which); 85 | int textFontWidth() const; 86 | int textFontHeight() const; 87 | 88 | 89 | private: 90 | const Font* _font; 91 | void FBtoBus(int x, int i); 92 | void WriteByte(); 93 | void BeforeWrite(); 94 | void BeginWrite(); 95 | void BeginWrite(int offset); //Checkme, offset maybe not needed or needs to be implemented differently?! 96 | void ResetBus(); 97 | //void SetControl(bool Clock, bool Shift, bool Myst, bool FLM); 98 | void WriteGPIO(int pin, bool state); 99 | void SetBusTristate(bool state); 100 | 101 | 102 | 103 | }; 104 | 105 | extern const struct Font Font_4x6; 106 | extern const struct Font Font_5x7; 107 | 108 | #endif -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:esp32doit-devkit-v1] 12 | platform = espressif32 13 | board = esp32doit-devkit-v1 14 | framework = arduino 15 | lib_deps = chris--a/Keypad@^3.1.1 16 | board_build.partitions = default_8MB.csv 17 | board_upload.flash_size = 8MB 18 | upload_port = COM[3] 19 | upload_speed = 115200 20 | -------------------------------------------------------------------------------- /src/Font_4x6.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the ArduinoGraphics library. 3 | Copyright (c) 2019 Arduino SA. All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "../include/Font.h" 21 | 22 | const struct Font Font_4x6 = { 23 | 4, 24 | 6, 25 | (const uint8_t*[]){ 26 | // char0 27 | (const uint8_t[]){ 28 | 0b10100000, 29 | 0b00000000, 30 | 0b10100000, 31 | 0b00000000, 32 | 0b10100000, 33 | 0b00000000, 34 | }, 35 | NULL, 36 | NULL, 37 | NULL, 38 | NULL, 39 | NULL, 40 | NULL, 41 | NULL, 42 | NULL, 43 | NULL, 44 | NULL, 45 | NULL, 46 | NULL, 47 | NULL, 48 | NULL, 49 | NULL, 50 | NULL, 51 | NULL, 52 | NULL, 53 | NULL, 54 | NULL, 55 | NULL, 56 | NULL, 57 | NULL, 58 | NULL, 59 | NULL, 60 | NULL, 61 | NULL, 62 | NULL, 63 | NULL, 64 | NULL, 65 | NULL, 66 | // space 67 | (const uint8_t[]){ 68 | 0b00000000, 69 | 0b00000000, 70 | 0b00000000, 71 | 0b00000000, 72 | 0b00000000, 73 | 0b00000000, 74 | }, 75 | // exclam 76 | (const uint8_t[]){ 77 | 0b01000000, 78 | 0b01000000, 79 | 0b01000000, 80 | 0b00000000, 81 | 0b01000000, 82 | 0b00000000, 83 | }, 84 | // quotedbl 85 | (const uint8_t[]){ 86 | 0b10100000, 87 | 0b10100000, 88 | 0b00000000, 89 | 0b00000000, 90 | 0b00000000, 91 | 0b00000000, 92 | }, 93 | // numbersign 94 | (const uint8_t[]){ 95 | 0b10100000, 96 | 0b11110000, 97 | 0b10100000, 98 | 0b11110000, 99 | 0b10100000, 100 | 0b00000000, 101 | }, 102 | // dollar 103 | (const uint8_t[]){ 104 | 0b01000000, 105 | 0b11100000, 106 | 0b11000000, 107 | 0b00100000, 108 | 0b11100000, 109 | 0b01000000, 110 | }, 111 | // percent 112 | (const uint8_t[]){ 113 | 0b10000000, 114 | 0b00100000, 115 | 0b01000000, 116 | 0b10000000, 117 | 0b00100000, 118 | 0b00000000, 119 | }, 120 | // ampersand 121 | (const uint8_t[]){ 122 | 0b01000000, 123 | 0b10100000, 124 | 0b01000000, 125 | 0b10100000, 126 | 0b01010000, 127 | 0b00000000, 128 | }, 129 | // quotesingle 130 | (const uint8_t[]){ 131 | 0b01000000, 132 | 0b01000000, 133 | 0b00000000, 134 | 0b00000000, 135 | 0b00000000, 136 | 0b00000000, 137 | }, 138 | // parenleft 139 | (const uint8_t[]){ 140 | 0b00100000, 141 | 0b01000000, 142 | 0b01000000, 143 | 0b01000000, 144 | 0b01000000, 145 | 0b00100000, 146 | }, 147 | // parenright 148 | (const uint8_t[]){ 149 | 0b10000000, 150 | 0b01000000, 151 | 0b01000000, 152 | 0b01000000, 153 | 0b01000000, 154 | 0b10000000, 155 | }, 156 | // asterisk 157 | (const uint8_t[]){ 158 | 0b10100000, 159 | 0b01000000, 160 | 0b11100000, 161 | 0b01000000, 162 | 0b10100000, 163 | 0b00000000, 164 | }, 165 | // plus 166 | (const uint8_t[]){ 167 | 0b01000000, 168 | 0b01000000, 169 | 0b11100000, 170 | 0b01000000, 171 | 0b01000000, 172 | 0b00000000, 173 | }, 174 | // comma 175 | (const uint8_t[]){ 176 | 0b00000000, 177 | 0b00000000, 178 | 0b00000000, 179 | 0b00000000, 180 | 0b01000000, 181 | 0b10000000, 182 | }, 183 | // hyphen 184 | (const uint8_t[]){ 185 | 0b00000000, 186 | 0b00000000, 187 | 0b11100000, 188 | 0b00000000, 189 | 0b00000000, 190 | 0b00000000, 191 | }, 192 | // period 193 | (const uint8_t[]){ 194 | 0b00000000, 195 | 0b00000000, 196 | 0b00000000, 197 | 0b00000000, 198 | 0b01000000, 199 | 0b00000000, 200 | }, 201 | // slash 202 | (const uint8_t[]){ 203 | 0b00100000, 204 | 0b00100000, 205 | 0b01000000, 206 | 0b10000000, 207 | 0b10000000, 208 | 0b00000000, 209 | }, 210 | // zero 211 | (const uint8_t[]){ 212 | 0b01000000, 213 | 0b10100000, 214 | 0b11100000, 215 | 0b10100000, 216 | 0b01000000, 217 | 0b00000000, 218 | }, 219 | // one 220 | (const uint8_t[]){ 221 | 0b01000000, 222 | 0b11000000, 223 | 0b01000000, 224 | 0b01000000, 225 | 0b11100000, 226 | 0b00000000, 227 | }, 228 | // two 229 | (const uint8_t[]){ 230 | 0b01000000, 231 | 0b10100000, 232 | 0b00100000, 233 | 0b01000000, 234 | 0b11100000, 235 | 0b00000000, 236 | }, 237 | // three 238 | (const uint8_t[]){ 239 | 0b11100000, 240 | 0b00100000, 241 | 0b01000000, 242 | 0b00100000, 243 | 0b11000000, 244 | 0b00000000, 245 | }, 246 | // four 247 | (const uint8_t[]){ 248 | 0b10100000, 249 | 0b10100000, 250 | 0b11100000, 251 | 0b00100000, 252 | 0b00100000, 253 | 0b00000000, 254 | }, 255 | // five 256 | (const uint8_t[]){ 257 | 0b11100000, 258 | 0b10000000, 259 | 0b11000000, 260 | 0b00100000, 261 | 0b11000000, 262 | 0b00000000, 263 | }, 264 | // six 265 | (const uint8_t[]){ 266 | 0b01100000, 267 | 0b10000000, 268 | 0b11000000, 269 | 0b10100000, 270 | 0b01000000, 271 | 0b00000000, 272 | }, 273 | // seven 274 | (const uint8_t[]){ 275 | 0b11100000, 276 | 0b00100000, 277 | 0b01000000, 278 | 0b10000000, 279 | 0b10000000, 280 | 0b00000000, 281 | }, 282 | // eight 283 | (const uint8_t[]){ 284 | 0b01100000, 285 | 0b10100000, 286 | 0b01000000, 287 | 0b10100000, 288 | 0b11000000, 289 | 0b00000000, 290 | }, 291 | // nine 292 | (const uint8_t[]){ 293 | 0b01000000, 294 | 0b10100000, 295 | 0b01100000, 296 | 0b00100000, 297 | 0b11000000, 298 | 0b00000000, 299 | }, 300 | // colon 301 | (const uint8_t[]){ 302 | 0b00000000, 303 | 0b01000000, 304 | 0b00000000, 305 | 0b00000000, 306 | 0b01000000, 307 | 0b00000000, 308 | }, 309 | // semicolon 310 | (const uint8_t[]){ 311 | 0b00000000, 312 | 0b01000000, 313 | 0b00000000, 314 | 0b00000000, 315 | 0b01000000, 316 | 0b10000000, 317 | }, 318 | // less 319 | (const uint8_t[]){ 320 | 0b00100000, 321 | 0b01000000, 322 | 0b10000000, 323 | 0b01000000, 324 | 0b00100000, 325 | 0b00000000, 326 | }, 327 | // equal 328 | (const uint8_t[]){ 329 | 0b00000000, 330 | 0b11100000, 331 | 0b00000000, 332 | 0b11100000, 333 | 0b00000000, 334 | 0b00000000, 335 | }, 336 | // greater 337 | (const uint8_t[]){ 338 | 0b10000000, 339 | 0b01000000, 340 | 0b00100000, 341 | 0b01000000, 342 | 0b10000000, 343 | 0b00000000, 344 | }, 345 | // question 346 | (const uint8_t[]){ 347 | 0b11000000, 348 | 0b00100000, 349 | 0b01000000, 350 | 0b00000000, 351 | 0b01000000, 352 | 0b00000000, 353 | }, 354 | // at 355 | (const uint8_t[]){ 356 | 0b01100000, 357 | 0b10100000, 358 | 0b10100000, 359 | 0b10000000, 360 | 0b01100000, 361 | 0b00000000, 362 | }, 363 | // A 364 | (const uint8_t[]){ 365 | 0b01000000, 366 | 0b10100000, 367 | 0b11100000, 368 | 0b10100000, 369 | 0b10100000, 370 | 0b00000000, 371 | }, 372 | // B 373 | (const uint8_t[]){ 374 | 0b11000000, 375 | 0b10100000, 376 | 0b11000000, 377 | 0b10100000, 378 | 0b11000000, 379 | 0b00000000, 380 | }, 381 | // C 382 | (const uint8_t[]){ 383 | 0b01000000, 384 | 0b10100000, 385 | 0b10000000, 386 | 0b10100000, 387 | 0b01000000, 388 | 0b00000000, 389 | }, 390 | // D 391 | (const uint8_t[]){ 392 | 0b11000000, 393 | 0b10100000, 394 | 0b10100000, 395 | 0b10100000, 396 | 0b11000000, 397 | 0b00000000, 398 | }, 399 | // E 400 | (const uint8_t[]){ 401 | 0b11100000, 402 | 0b10000000, 403 | 0b11000000, 404 | 0b10000000, 405 | 0b11100000, 406 | 0b00000000, 407 | }, 408 | // F 409 | (const uint8_t[]){ 410 | 0b11100000, 411 | 0b10000000, 412 | 0b11000000, 413 | 0b10000000, 414 | 0b10000000, 415 | 0b00000000, 416 | }, 417 | // G 418 | (const uint8_t[]){ 419 | 0b01100000, 420 | 0b10000000, 421 | 0b10100000, 422 | 0b10100000, 423 | 0b01100000, 424 | 0b00000000, 425 | }, 426 | // H 427 | (const uint8_t[]){ 428 | 0b10100000, 429 | 0b10100000, 430 | 0b11100000, 431 | 0b10100000, 432 | 0b10100000, 433 | 0b00000000, 434 | }, 435 | // I 436 | (const uint8_t[]){ 437 | 0b11100000, 438 | 0b01000000, 439 | 0b01000000, 440 | 0b01000000, 441 | 0b11100000, 442 | 0b00000000, 443 | }, 444 | // J 445 | (const uint8_t[]){ 446 | 0b00100000, 447 | 0b00100000, 448 | 0b00100000, 449 | 0b10100000, 450 | 0b01000000, 451 | 0b00000000, 452 | }, 453 | // K 454 | (const uint8_t[]){ 455 | 0b10100000, 456 | 0b10100000, 457 | 0b11000000, 458 | 0b10100000, 459 | 0b10100000, 460 | 0b00000000, 461 | }, 462 | // L 463 | (const uint8_t[]){ 464 | 0b10000000, 465 | 0b10000000, 466 | 0b10000000, 467 | 0b10000000, 468 | 0b11100000, 469 | 0b00000000, 470 | }, 471 | // M 472 | (const uint8_t[]){ 473 | 0b10100000, 474 | 0b11100000, 475 | 0b11100000, 476 | 0b10100000, 477 | 0b10100000, 478 | 0b00000000, 479 | }, 480 | // N 481 | (const uint8_t[]){ 482 | 0b00100000, 483 | 0b10100000, 484 | 0b11100000, 485 | 0b10100000, 486 | 0b10000000, 487 | 0b00000000, 488 | }, 489 | // O 490 | (const uint8_t[]){ 491 | 0b01000000, 492 | 0b10100000, 493 | 0b10100000, 494 | 0b10100000, 495 | 0b01000000, 496 | 0b00000000, 497 | }, 498 | // P 499 | (const uint8_t[]){ 500 | 0b11000000, 501 | 0b10100000, 502 | 0b11000000, 503 | 0b10000000, 504 | 0b10000000, 505 | 0b00000000, 506 | }, 507 | // Q 508 | (const uint8_t[]){ 509 | 0b01000000, 510 | 0b10100000, 511 | 0b10100000, 512 | 0b10100000, 513 | 0b01000000, 514 | 0b00100000, 515 | }, 516 | // R 517 | (const uint8_t[]){ 518 | 0b11000000, 519 | 0b10100000, 520 | 0b11000000, 521 | 0b10100000, 522 | 0b10100000, 523 | 0b00000000, 524 | }, 525 | // S 526 | (const uint8_t[]){ 527 | 0b01100000, 528 | 0b10000000, 529 | 0b01000000, 530 | 0b00100000, 531 | 0b11000000, 532 | 0b00000000, 533 | }, 534 | // T 535 | (const uint8_t[]){ 536 | 0b11100000, 537 | 0b01000000, 538 | 0b01000000, 539 | 0b01000000, 540 | 0b01000000, 541 | 0b00000000, 542 | }, 543 | // U 544 | (const uint8_t[]){ 545 | 0b10100000, 546 | 0b10100000, 547 | 0b10100000, 548 | 0b10100000, 549 | 0b11100000, 550 | 0b00000000, 551 | }, 552 | // V 553 | (const uint8_t[]){ 554 | 0b10100000, 555 | 0b10100000, 556 | 0b10100000, 557 | 0b11100000, 558 | 0b01000000, 559 | 0b00000000, 560 | }, 561 | // W 562 | (const uint8_t[]){ 563 | 0b10100000, 564 | 0b10100000, 565 | 0b11100000, 566 | 0b11100000, 567 | 0b10100000, 568 | 0b00000000, 569 | }, 570 | // X 571 | (const uint8_t[]){ 572 | 0b10100000, 573 | 0b10100000, 574 | 0b01000000, 575 | 0b10100000, 576 | 0b10100000, 577 | 0b00000000, 578 | }, 579 | // Y 580 | (const uint8_t[]){ 581 | 0b10100000, 582 | 0b10100000, 583 | 0b01000000, 584 | 0b01000000, 585 | 0b01000000, 586 | 0b00000000, 587 | }, 588 | // Z 589 | (const uint8_t[]){ 590 | 0b11100000, 591 | 0b00100000, 592 | 0b01000000, 593 | 0b10000000, 594 | 0b11100000, 595 | 0b00000000, 596 | }, 597 | // bracketleft 598 | (const uint8_t[]){ 599 | 0b01100000, 600 | 0b01000000, 601 | 0b01000000, 602 | 0b01000000, 603 | 0b01100000, 604 | 0b00000000, 605 | }, 606 | // backslash 607 | (const uint8_t[]){ 608 | 0b10000000, 609 | 0b10000000, 610 | 0b01000000, 611 | 0b00100000, 612 | 0b00100000, 613 | 0b00000000, 614 | }, 615 | // bracketright 616 | (const uint8_t[]){ 617 | 0b11000000, 618 | 0b01000000, 619 | 0b01000000, 620 | 0b01000000, 621 | 0b11000000, 622 | 0b00000000, 623 | }, 624 | // asciicircum 625 | (const uint8_t[]){ 626 | 0b01000000, 627 | 0b10100000, 628 | 0b00000000, 629 | 0b00000000, 630 | 0b00000000, 631 | 0b00000000, 632 | }, 633 | // underscore 634 | (const uint8_t[]){ 635 | 0b00000000, 636 | 0b00000000, 637 | 0b00000000, 638 | 0b00000000, 639 | 0b00000000, 640 | 0b11100000, 641 | }, 642 | // grave 643 | (const uint8_t[]){ 644 | 0b01000000, 645 | 0b00100000, 646 | 0b00000000, 647 | 0b00000000, 648 | 0b00000000, 649 | 0b00000000, 650 | }, 651 | // a 652 | (const uint8_t[]){ 653 | 0b00000000, 654 | 0b01100000, 655 | 0b10100000, 656 | 0b10100000, 657 | 0b01100000, 658 | 0b00000000, 659 | }, 660 | // b 661 | (const uint8_t[]){ 662 | 0b10000000, 663 | 0b11000000, 664 | 0b10100000, 665 | 0b10100000, 666 | 0b11000000, 667 | 0b00000000, 668 | }, 669 | // c 670 | (const uint8_t[]){ 671 | 0b00000000, 672 | 0b01100000, 673 | 0b10000000, 674 | 0b10000000, 675 | 0b01100000, 676 | 0b00000000, 677 | }, 678 | // d 679 | (const uint8_t[]){ 680 | 0b00100000, 681 | 0b01100000, 682 | 0b10100000, 683 | 0b10100000, 684 | 0b01100000, 685 | 0b00000000, 686 | }, 687 | // e 688 | (const uint8_t[]){ 689 | 0b00000000, 690 | 0b01000000, 691 | 0b10100000, 692 | 0b11000000, 693 | 0b01100000, 694 | 0b00000000, 695 | }, 696 | // f 697 | (const uint8_t[]){ 698 | 0b00100000, 699 | 0b01000000, 700 | 0b11100000, 701 | 0b01000000, 702 | 0b01000000, 703 | 0b00000000, 704 | }, 705 | // g 706 | (const uint8_t[]){ 707 | 0b00000000, 708 | 0b01100000, 709 | 0b10100000, 710 | 0b01100000, 711 | 0b00100000, 712 | 0b11000000, 713 | }, 714 | // h 715 | (const uint8_t[]){ 716 | 0b10000000, 717 | 0b11000000, 718 | 0b10100000, 719 | 0b10100000, 720 | 0b10100000, 721 | 0b00000000, 722 | }, 723 | // i 724 | (const uint8_t[]){ 725 | 0b01000000, 726 | 0b00000000, 727 | 0b11000000, 728 | 0b01000000, 729 | 0b11100000, 730 | 0b00000000, 731 | }, 732 | // j 733 | (const uint8_t[]){ 734 | 0b00100000, 735 | 0b00000000, 736 | 0b00100000, 737 | 0b00100000, 738 | 0b00100000, 739 | 0b11000000, 740 | }, 741 | // k 742 | (const uint8_t[]){ 743 | 0b10000000, 744 | 0b10100000, 745 | 0b11000000, 746 | 0b10100000, 747 | 0b10100000, 748 | 0b00000000, 749 | }, 750 | // l 751 | (const uint8_t[]){ 752 | 0b11000000, 753 | 0b01000000, 754 | 0b01000000, 755 | 0b01000000, 756 | 0b11100000, 757 | 0b00000000, 758 | }, 759 | // m 760 | (const uint8_t[]){ 761 | 0b00000000, 762 | 0b10100000, 763 | 0b11100000, 764 | 0b10100000, 765 | 0b10100000, 766 | 0b00000000, 767 | }, 768 | // n 769 | (const uint8_t[]){ 770 | 0b00000000, 771 | 0b11000000, 772 | 0b10100000, 773 | 0b10100000, 774 | 0b10100000, 775 | 0b00000000, 776 | }, 777 | // o 778 | (const uint8_t[]){ 779 | 0b00000000, 780 | 0b01000000, 781 | 0b10100000, 782 | 0b10100000, 783 | 0b01000000, 784 | 0b00000000, 785 | }, 786 | // p 787 | (const uint8_t[]){ 788 | 0b00000000, 789 | 0b11000000, 790 | 0b10100000, 791 | 0b11000000, 792 | 0b10000000, 793 | 0b10000000, 794 | }, 795 | // q 796 | (const uint8_t[]){ 797 | 0b00000000, 798 | 0b01100000, 799 | 0b10100000, 800 | 0b10100000, 801 | 0b01100000, 802 | 0b00100000, 803 | }, 804 | // r 805 | (const uint8_t[]){ 806 | 0b00000000, 807 | 0b10100000, 808 | 0b11000000, 809 | 0b10000000, 810 | 0b10000000, 811 | 0b00000000, 812 | }, 813 | // s 814 | (const uint8_t[]){ 815 | 0b00000000, 816 | 0b01100000, 817 | 0b11000000, 818 | 0b00100000, 819 | 0b11000000, 820 | 0b00000000, 821 | }, 822 | // t 823 | (const uint8_t[]){ 824 | 0b01000000, 825 | 0b11100000, 826 | 0b01000000, 827 | 0b01000000, 828 | 0b00100000, 829 | 0b00000000, 830 | }, 831 | // u 832 | (const uint8_t[]){ 833 | 0b00000000, 834 | 0b10100000, 835 | 0b10100000, 836 | 0b10100000, 837 | 0b01100000, 838 | 0b00000000, 839 | }, 840 | // v 841 | (const uint8_t[]){ 842 | 0b00000000, 843 | 0b10100000, 844 | 0b10100000, 845 | 0b10100000, 846 | 0b01000000, 847 | 0b00000000, 848 | }, 849 | // w 850 | (const uint8_t[]){ 851 | 0b00000000, 852 | 0b10100000, 853 | 0b10100000, 854 | 0b11100000, 855 | 0b10100000, 856 | 0b00000000, 857 | }, 858 | // x 859 | (const uint8_t[]){ 860 | 0b00000000, 861 | 0b10100000, 862 | 0b01000000, 863 | 0b01000000, 864 | 0b10100000, 865 | 0b00000000, 866 | }, 867 | // y 868 | (const uint8_t[]){ 869 | 0b00000000, 870 | 0b10100000, 871 | 0b10100000, 872 | 0b01100000, 873 | 0b00100000, 874 | 0b11000000, 875 | }, 876 | // z 877 | (const uint8_t[]){ 878 | 0b00000000, 879 | 0b11100000, 880 | 0b00100000, 881 | 0b01000000, 882 | 0b11100000, 883 | 0b00000000, 884 | }, 885 | // braceleft 886 | (const uint8_t[]){ 887 | 0b00100000, 888 | 0b01000000, 889 | 0b11000000, 890 | 0b01000000, 891 | 0b01000000, 892 | 0b00100000, 893 | }, 894 | // bar 895 | (const uint8_t[]){ 896 | 0b01000000, 897 | 0b01000000, 898 | 0b01000000, 899 | 0b01000000, 900 | 0b01000000, 901 | 0b00000000, 902 | }, 903 | // braceright 904 | (const uint8_t[]){ 905 | 0b10000000, 906 | 0b01000000, 907 | 0b01100000, 908 | 0b01000000, 909 | 0b01000000, 910 | 0b10000000, 911 | }, 912 | // asciitilde 913 | (const uint8_t[]){ 914 | 0b01010000, 915 | 0b10100000, 916 | 0b00000000, 917 | 0b00000000, 918 | 0b00000000, 919 | 0b00000000, 920 | }, 921 | NULL, 922 | NULL, 923 | NULL, 924 | NULL, 925 | NULL, 926 | NULL, 927 | NULL, 928 | NULL, 929 | NULL, 930 | NULL, 931 | NULL, 932 | NULL, 933 | NULL, 934 | NULL, 935 | NULL, 936 | NULL, 937 | NULL, 938 | NULL, 939 | NULL, 940 | NULL, 941 | NULL, 942 | NULL, 943 | NULL, 944 | NULL, 945 | NULL, 946 | NULL, 947 | NULL, 948 | NULL, 949 | NULL, 950 | NULL, 951 | NULL, 952 | NULL, 953 | NULL, 954 | // space 955 | (const uint8_t[]){ 956 | 0b00000000, 957 | 0b00000000, 958 | 0b00000000, 959 | 0b00000000, 960 | 0b00000000, 961 | 0b00000000, 962 | }, 963 | // exclamdown 964 | (const uint8_t[]){ 965 | 0b01000000, 966 | 0b00000000, 967 | 0b01000000, 968 | 0b01000000, 969 | 0b01000000, 970 | 0b00000000, 971 | }, 972 | // cent 973 | (const uint8_t[]){ 974 | 0b01000000, 975 | 0b11100000, 976 | 0b10000000, 977 | 0b11100000, 978 | 0b01000000, 979 | 0b00000000, 980 | }, 981 | // sterling 982 | (const uint8_t[]){ 983 | 0b00100000, 984 | 0b01000000, 985 | 0b01100000, 986 | 0b01000000, 987 | 0b10100000, 988 | 0b00000000, 989 | }, 990 | // currency 991 | (const uint8_t[]){ 992 | 0b00000000, 993 | 0b10010000, 994 | 0b01100000, 995 | 0b01100000, 996 | 0b10010000, 997 | 0b00000000, 998 | }, 999 | // yen 1000 | (const uint8_t[]){ 1001 | 0b10100000, 1002 | 0b01000000, 1003 | 0b11100000, 1004 | 0b01000000, 1005 | 0b01000000, 1006 | 0b00000000, 1007 | }, 1008 | // brokenbar 1009 | (const uint8_t[]){ 1010 | 0b01000000, 1011 | 0b01000000, 1012 | 0b00000000, 1013 | 0b01000000, 1014 | 0b01000000, 1015 | 0b00000000, 1016 | }, 1017 | // section 1018 | (const uint8_t[]){ 1019 | 0b01100000, 1020 | 0b11000000, 1021 | 0b10100000, 1022 | 0b01100000, 1023 | 0b00100000, 1024 | 0b11000000, 1025 | }, 1026 | // dieresis 1027 | (const uint8_t[]){ 1028 | 0b10100000, 1029 | 0b00000000, 1030 | 0b00000000, 1031 | 0b00000000, 1032 | 0b00000000, 1033 | 0b00000000, 1034 | }, 1035 | // copyright 1036 | (const uint8_t[]){ 1037 | 0b01100000, 1038 | 0b10010000, 1039 | 0b11010000, 1040 | 0b11010000, 1041 | 0b10010000, 1042 | 0b01100000, 1043 | }, 1044 | // ordfeminine 1045 | (const uint8_t[]){ 1046 | 0b01100000, 1047 | 0b10100000, 1048 | 0b01100000, 1049 | 0b00000000, 1050 | 0b11100000, 1051 | 0b00000000, 1052 | }, 1053 | // guillemotleft 1054 | (const uint8_t[]){ 1055 | 0b00000000, 1056 | 0b01010000, 1057 | 0b10100000, 1058 | 0b01010000, 1059 | 0b00000000, 1060 | 0b00000000, 1061 | }, 1062 | // logicalnot 1063 | (const uint8_t[]){ 1064 | 0b00000000, 1065 | 0b00000000, 1066 | 0b11100000, 1067 | 0b00100000, 1068 | 0b00000000, 1069 | 0b00000000, 1070 | }, 1071 | // hyphen 1072 | (const uint8_t[]){ 1073 | 0b00000000, 1074 | 0b00000000, 1075 | 0b11100000, 1076 | 0b00000000, 1077 | 0b00000000, 1078 | 0b00000000, 1079 | }, 1080 | // registered 1081 | (const uint8_t[]){ 1082 | 0b01100000, 1083 | 0b11110000, 1084 | 0b11010000, 1085 | 0b01100000, 1086 | 0b00000000, 1087 | 0b00000000, 1088 | }, 1089 | // macron 1090 | (const uint8_t[]){ 1091 | 0b11100000, 1092 | 0b00000000, 1093 | 0b00000000, 1094 | 0b00000000, 1095 | 0b00000000, 1096 | 0b00000000, 1097 | }, 1098 | // degree 1099 | (const uint8_t[]){ 1100 | 0b01000000, 1101 | 0b10100000, 1102 | 0b01000000, 1103 | 0b00000000, 1104 | 0b00000000, 1105 | 0b00000000, 1106 | }, 1107 | // plusminus 1108 | (const uint8_t[]){ 1109 | 0b01000000, 1110 | 0b11100000, 1111 | 0b01000000, 1112 | 0b00000000, 1113 | 0b11100000, 1114 | 0b00000000, 1115 | }, 1116 | // twosuperior 1117 | (const uint8_t[]){ 1118 | 0b11000000, 1119 | 0b01000000, 1120 | 0b10000000, 1121 | 0b11000000, 1122 | 0b00000000, 1123 | 0b00000000, 1124 | }, 1125 | // threesuperior 1126 | (const uint8_t[]){ 1127 | 0b11000000, 1128 | 0b01000000, 1129 | 0b10000000, 1130 | 0b01000000, 1131 | 0b10000000, 1132 | 0b00000000, 1133 | }, 1134 | // acute 1135 | (const uint8_t[]){ 1136 | 0b00100000, 1137 | 0b01000000, 1138 | 0b00000000, 1139 | 0b00000000, 1140 | 0b00000000, 1141 | 0b00000000, 1142 | }, 1143 | // mu 1144 | (const uint8_t[]){ 1145 | 0b00000000, 1146 | 0b10100000, 1147 | 0b10100000, 1148 | 0b10100000, 1149 | 0b11000000, 1150 | 0b10000000, 1151 | }, 1152 | // paragraph 1153 | (const uint8_t[]){ 1154 | 0b01110000, 1155 | 0b11010000, 1156 | 0b11010000, 1157 | 0b01010000, 1158 | 0b01010000, 1159 | 0b00000000, 1160 | }, 1161 | // periodcentered 1162 | (const uint8_t[]){ 1163 | 0b00000000, 1164 | 0b00000000, 1165 | 0b01000000, 1166 | 0b00000000, 1167 | 0b00000000, 1168 | 0b00000000, 1169 | }, 1170 | // cedilla 1171 | (const uint8_t[]){ 1172 | 0b00000000, 1173 | 0b00000000, 1174 | 0b00000000, 1175 | 0b00100000, 1176 | 0b01000000, 1177 | 0b00000000, 1178 | }, 1179 | // onesuperior 1180 | (const uint8_t[]){ 1181 | 0b01000000, 1182 | 0b11000000, 1183 | 0b01000000, 1184 | 0b01000000, 1185 | 0b00000000, 1186 | 0b00000000, 1187 | }, 1188 | // ordmasculine 1189 | (const uint8_t[]){ 1190 | 0b01000000, 1191 | 0b10100000, 1192 | 0b01000000, 1193 | 0b00000000, 1194 | 0b11100000, 1195 | 0b00000000, 1196 | }, 1197 | // guillemotright 1198 | (const uint8_t[]){ 1199 | 0b00000000, 1200 | 0b10100000, 1201 | 0b01010000, 1202 | 0b10100000, 1203 | 0b00000000, 1204 | 0b00000000, 1205 | }, 1206 | // onequarter 1207 | (const uint8_t[]){ 1208 | 0b10000000, 1209 | 0b10000000, 1210 | 0b10000000, 1211 | 0b01010000, 1212 | 0b01110000, 1213 | 0b00010000, 1214 | }, 1215 | // onehalf 1216 | (const uint8_t[]){ 1217 | 0b10000000, 1218 | 0b10000000, 1219 | 0b10110000, 1220 | 0b00010000, 1221 | 0b00100000, 1222 | 0b00110000, 1223 | }, 1224 | // threequarters 1225 | (const uint8_t[]){ 1226 | 0b11000000, 1227 | 0b01000000, 1228 | 0b10000000, 1229 | 0b01010000, 1230 | 0b10110000, 1231 | 0b00010000, 1232 | }, 1233 | // questiondown 1234 | (const uint8_t[]){ 1235 | 0b01000000, 1236 | 0b00000000, 1237 | 0b01000000, 1238 | 0b10000000, 1239 | 0b01100000, 1240 | 0b00000000, 1241 | }, 1242 | // Agrave 1243 | (const uint8_t[]){ 1244 | 0b10000000, 1245 | 0b01000000, 1246 | 0b10100000, 1247 | 0b11100000, 1248 | 0b10100000, 1249 | 0b00000000, 1250 | }, 1251 | // Aacute 1252 | (const uint8_t[]){ 1253 | 0b00100000, 1254 | 0b01000000, 1255 | 0b10100000, 1256 | 0b11100000, 1257 | 0b10100000, 1258 | 0b00000000, 1259 | }, 1260 | // Acircumflex 1261 | (const uint8_t[]){ 1262 | 0b11000000, 1263 | 0b01000000, 1264 | 0b10100000, 1265 | 0b11100000, 1266 | 0b10100000, 1267 | 0b00000000, 1268 | }, 1269 | // Atilde 1270 | (const uint8_t[]){ 1271 | 0b01100000, 1272 | 0b11000000, 1273 | 0b10100000, 1274 | 0b11100000, 1275 | 0b10100000, 1276 | 0b00000000, 1277 | }, 1278 | // Adieresis 1279 | (const uint8_t[]){ 1280 | 0b10100000, 1281 | 0b01000000, 1282 | 0b10100000, 1283 | 0b11100000, 1284 | 0b10100000, 1285 | 0b00000000, 1286 | }, 1287 | // Aring 1288 | (const uint8_t[]){ 1289 | 0b01000000, 1290 | 0b01000000, 1291 | 0b10100000, 1292 | 0b11100000, 1293 | 0b10100000, 1294 | 0b00000000, 1295 | }, 1296 | // AE 1297 | (const uint8_t[]){ 1298 | 0b01110000, 1299 | 0b10100000, 1300 | 0b11110000, 1301 | 0b10100000, 1302 | 0b10110000, 1303 | 0b00000000, 1304 | }, 1305 | // Ccedilla 1306 | (const uint8_t[]){ 1307 | 0b01000000, 1308 | 0b10100000, 1309 | 0b10000000, 1310 | 0b10100000, 1311 | 0b01000000, 1312 | 0b10000000, 1313 | }, 1314 | // Egrave 1315 | (const uint8_t[]){ 1316 | 0b10000000, 1317 | 0b11100000, 1318 | 0b11000000, 1319 | 0b10000000, 1320 | 0b11100000, 1321 | 0b00000000, 1322 | }, 1323 | // Eacute 1324 | (const uint8_t[]){ 1325 | 0b00100000, 1326 | 0b11100000, 1327 | 0b11000000, 1328 | 0b10000000, 1329 | 0b11100000, 1330 | 0b00000000, 1331 | }, 1332 | // Ecircumflex 1333 | (const uint8_t[]){ 1334 | 0b01100000, 1335 | 0b11100000, 1336 | 0b11000000, 1337 | 0b10000000, 1338 | 0b11100000, 1339 | 0b00000000, 1340 | }, 1341 | // Edieresis 1342 | (const uint8_t[]){ 1343 | 0b10100000, 1344 | 0b11100000, 1345 | 0b11000000, 1346 | 0b10000000, 1347 | 0b11100000, 1348 | 0b00000000, 1349 | }, 1350 | // Igrave 1351 | (const uint8_t[]){ 1352 | 0b10000000, 1353 | 0b11100000, 1354 | 0b01000000, 1355 | 0b01000000, 1356 | 0b11100000, 1357 | 0b00000000, 1358 | }, 1359 | // Iacute 1360 | (const uint8_t[]){ 1361 | 0b00100000, 1362 | 0b11100000, 1363 | 0b01000000, 1364 | 0b01000000, 1365 | 0b11100000, 1366 | 0b00000000, 1367 | }, 1368 | // Icircumflex 1369 | (const uint8_t[]){ 1370 | 0b01000000, 1371 | 0b11100000, 1372 | 0b01000000, 1373 | 0b01000000, 1374 | 0b11100000, 1375 | 0b00000000, 1376 | }, 1377 | // Idieresis 1378 | (const uint8_t[]){ 1379 | 0b10100000, 1380 | 0b01000000, 1381 | 0b01000000, 1382 | 0b01000000, 1383 | 0b11100000, 1384 | 0b00000000, 1385 | }, 1386 | // Eth 1387 | (const uint8_t[]){ 1388 | 0b11100000, 1389 | 0b01010000, 1390 | 0b11010000, 1391 | 0b01010000, 1392 | 0b11100000, 1393 | 0b00000000, 1394 | }, 1395 | // Ntilde 1396 | (const uint8_t[]){ 1397 | 0b01010000, 1398 | 0b10100000, 1399 | 0b11100000, 1400 | 0b11100000, 1401 | 0b10100000, 1402 | 0b00000000, 1403 | }, 1404 | // Ograve 1405 | (const uint8_t[]){ 1406 | 0b10000000, 1407 | 0b01000000, 1408 | 0b10100000, 1409 | 0b10100000, 1410 | 0b01000000, 1411 | 0b00000000, 1412 | }, 1413 | // Oacute 1414 | (const uint8_t[]){ 1415 | 0b00100000, 1416 | 0b01000000, 1417 | 0b10100000, 1418 | 0b10100000, 1419 | 0b01000000, 1420 | 0b00000000, 1421 | }, 1422 | // Ocircumflex 1423 | (const uint8_t[]){ 1424 | 0b01000000, 1425 | 0b01000000, 1426 | 0b10100000, 1427 | 0b10100000, 1428 | 0b01000000, 1429 | 0b00000000, 1430 | }, 1431 | // Otilde 1432 | (const uint8_t[]){ 1433 | 0b01110000, 1434 | 0b11100000, 1435 | 0b10100000, 1436 | 0b10100000, 1437 | 0b01000000, 1438 | 0b00000000, 1439 | }, 1440 | // Odieresis 1441 | (const uint8_t[]){ 1442 | 0b10100000, 1443 | 0b01000000, 1444 | 0b10100000, 1445 | 0b10100000, 1446 | 0b01000000, 1447 | 0b00000000, 1448 | }, 1449 | // multiply 1450 | (const uint8_t[]){ 1451 | 0b00000000, 1452 | 0b10100000, 1453 | 0b01000000, 1454 | 0b10100000, 1455 | 0b00000000, 1456 | 0b00000000, 1457 | }, 1458 | // Oslash 1459 | (const uint8_t[]){ 1460 | 0b01100000, 1461 | 0b10100000, 1462 | 0b11100000, 1463 | 0b10100000, 1464 | 0b11000000, 1465 | 0b00000000, 1466 | }, 1467 | // Ugrave 1468 | (const uint8_t[]){ 1469 | 0b10000000, 1470 | 0b01000000, 1471 | 0b10100000, 1472 | 0b10100000, 1473 | 0b11100000, 1474 | 0b00000000, 1475 | }, 1476 | // Uacute 1477 | (const uint8_t[]){ 1478 | 0b00100000, 1479 | 0b01000000, 1480 | 0b10100000, 1481 | 0b10100000, 1482 | 0b11100000, 1483 | 0b00000000, 1484 | }, 1485 | // Ucircumflex 1486 | (const uint8_t[]){ 1487 | 0b01000000, 1488 | 0b00000000, 1489 | 0b10100000, 1490 | 0b10100000, 1491 | 0b11100000, 1492 | 0b00000000, 1493 | }, 1494 | // Udieresis 1495 | (const uint8_t[]){ 1496 | 0b10100000, 1497 | 0b00000000, 1498 | 0b10100000, 1499 | 0b10100000, 1500 | 0b11100000, 1501 | 0b00000000, 1502 | }, 1503 | // Yacute 1504 | (const uint8_t[]){ 1505 | 0b00100000, 1506 | 0b00000000, 1507 | 0b10100000, 1508 | 0b01000000, 1509 | 0b01000000, 1510 | 0b00000000, 1511 | }, 1512 | // Thorn 1513 | (const uint8_t[]){ 1514 | 0b10000000, 1515 | 0b11000000, 1516 | 0b10100000, 1517 | 0b11000000, 1518 | 0b10000000, 1519 | 0b00000000, 1520 | }, 1521 | // germandbls 1522 | (const uint8_t[]){ 1523 | 0b01000000, 1524 | 0b10100000, 1525 | 0b11000000, 1526 | 0b10100000, 1527 | 0b11100000, 1528 | 0b10000000, 1529 | }, 1530 | // agrave 1531 | (const uint8_t[]){ 1532 | 0b10000000, 1533 | 0b01000000, 1534 | 0b01100000, 1535 | 0b10100000, 1536 | 0b01100000, 1537 | 0b00000000, 1538 | }, 1539 | // aacute 1540 | (const uint8_t[]){ 1541 | 0b00100000, 1542 | 0b01000000, 1543 | 0b01100000, 1544 | 0b10100000, 1545 | 0b01100000, 1546 | 0b00000000, 1547 | }, 1548 | // acircumflex 1549 | (const uint8_t[]){ 1550 | 0b01100000, 1551 | 0b00000000, 1552 | 0b01100000, 1553 | 0b10100000, 1554 | 0b01100000, 1555 | 0b00000000, 1556 | }, 1557 | // atilde 1558 | (const uint8_t[]){ 1559 | 0b01010000, 1560 | 0b10100000, 1561 | 0b01100000, 1562 | 0b10100000, 1563 | 0b01100000, 1564 | 0b00000000, 1565 | }, 1566 | // adieresis 1567 | (const uint8_t[]){ 1568 | 0b10100000, 1569 | 0b00000000, 1570 | 0b01100000, 1571 | 0b10100000, 1572 | 0b01100000, 1573 | 0b00000000, 1574 | }, 1575 | // aring 1576 | (const uint8_t[]){ 1577 | 0b01000000, 1578 | 0b00000000, 1579 | 0b01100000, 1580 | 0b10100000, 1581 | 0b01100000, 1582 | 0b00000000, 1583 | }, 1584 | // ae 1585 | (const uint8_t[]){ 1586 | 0b00000000, 1587 | 0b01110000, 1588 | 0b10110000, 1589 | 0b10100000, 1590 | 0b01110000, 1591 | 0b00000000, 1592 | }, 1593 | // ccedilla 1594 | (const uint8_t[]){ 1595 | 0b00000000, 1596 | 0b01000000, 1597 | 0b10100000, 1598 | 0b10000000, 1599 | 0b01100000, 1600 | 0b01000000, 1601 | }, 1602 | // egrave 1603 | (const uint8_t[]){ 1604 | 0b10000000, 1605 | 0b01000000, 1606 | 0b10100000, 1607 | 0b11000000, 1608 | 0b01100000, 1609 | 0b00000000, 1610 | }, 1611 | // eacute 1612 | (const uint8_t[]){ 1613 | 0b00100000, 1614 | 0b01000000, 1615 | 0b10100000, 1616 | 0b11000000, 1617 | 0b01100000, 1618 | 0b00000000, 1619 | }, 1620 | // ecircumflex 1621 | (const uint8_t[]){ 1622 | 0b11000000, 1623 | 0b01000000, 1624 | 0b10100000, 1625 | 0b11000000, 1626 | 0b01100000, 1627 | 0b00000000, 1628 | }, 1629 | // edieresis 1630 | (const uint8_t[]){ 1631 | 0b10100000, 1632 | 0b01000000, 1633 | 0b10100000, 1634 | 0b11000000, 1635 | 0b01100000, 1636 | 0b00000000, 1637 | }, 1638 | // igrave 1639 | (const uint8_t[]){ 1640 | 0b10000000, 1641 | 0b01000000, 1642 | 0b01000000, 1643 | 0b01000000, 1644 | 0b11100000, 1645 | 0b00000000, 1646 | }, 1647 | // iacute 1648 | (const uint8_t[]){ 1649 | 0b00100000, 1650 | 0b11000000, 1651 | 0b01000000, 1652 | 0b01000000, 1653 | 0b11100000, 1654 | 0b00000000, 1655 | }, 1656 | // icircumflex 1657 | (const uint8_t[]){ 1658 | 0b01000000, 1659 | 0b10100000, 1660 | 0b01000000, 1661 | 0b01000000, 1662 | 0b11100000, 1663 | 0b00000000, 1664 | }, 1665 | // idieresis 1666 | (const uint8_t[]){ 1667 | 0b10100000, 1668 | 0b00000000, 1669 | 0b11000000, 1670 | 0b01000000, 1671 | 0b11100000, 1672 | 0b00000000, 1673 | }, 1674 | // eth 1675 | (const uint8_t[]){ 1676 | 0b10100000, 1677 | 0b01000000, 1678 | 0b01100000, 1679 | 0b10100000, 1680 | 0b01000000, 1681 | 0b00000000, 1682 | }, 1683 | // ntilde 1684 | (const uint8_t[]){ 1685 | 0b01010000, 1686 | 0b10100000, 1687 | 0b11000000, 1688 | 0b10100000, 1689 | 0b10100000, 1690 | 0b00000000, 1691 | }, 1692 | // ograve 1693 | (const uint8_t[]){ 1694 | 0b10000000, 1695 | 0b01000000, 1696 | 0b01000000, 1697 | 0b10100000, 1698 | 0b01000000, 1699 | 0b00000000, 1700 | }, 1701 | // oacute 1702 | (const uint8_t[]){ 1703 | 0b00100000, 1704 | 0b01000000, 1705 | 0b01000000, 1706 | 0b10100000, 1707 | 0b01000000, 1708 | 0b00000000, 1709 | }, 1710 | // ocircumflex 1711 | (const uint8_t[]){ 1712 | 0b01000000, 1713 | 0b00000000, 1714 | 0b01000000, 1715 | 0b10100000, 1716 | 0b01000000, 1717 | 0b00000000, 1718 | }, 1719 | // otilde 1720 | (const uint8_t[]){ 1721 | 0b11100000, 1722 | 0b00000000, 1723 | 0b01000000, 1724 | 0b10100000, 1725 | 0b01000000, 1726 | 0b00000000, 1727 | }, 1728 | // odieresis 1729 | (const uint8_t[]){ 1730 | 0b10100000, 1731 | 0b00000000, 1732 | 0b01000000, 1733 | 0b10100000, 1734 | 0b01000000, 1735 | 0b00000000, 1736 | }, 1737 | // divide 1738 | (const uint8_t[]){ 1739 | 0b01000000, 1740 | 0b00000000, 1741 | 0b11100000, 1742 | 0b00000000, 1743 | 0b01000000, 1744 | 0b00000000, 1745 | }, 1746 | // oslash 1747 | (const uint8_t[]){ 1748 | 0b00000000, 1749 | 0b01100000, 1750 | 0b10100000, 1751 | 0b10100000, 1752 | 0b11000000, 1753 | 0b00000000, 1754 | }, 1755 | // ugrave 1756 | (const uint8_t[]){ 1757 | 0b10000000, 1758 | 0b01000000, 1759 | 0b10100000, 1760 | 0b10100000, 1761 | 0b01100000, 1762 | 0b00000000, 1763 | }, 1764 | // uacute 1765 | (const uint8_t[]){ 1766 | 0b00100000, 1767 | 0b01000000, 1768 | 0b10100000, 1769 | 0b10100000, 1770 | 0b01100000, 1771 | 0b00000000, 1772 | }, 1773 | // ucircumflex 1774 | (const uint8_t[]){ 1775 | 0b01000000, 1776 | 0b00000000, 1777 | 0b10100000, 1778 | 0b10100000, 1779 | 0b01100000, 1780 | 0b00000000, 1781 | }, 1782 | // udieresis 1783 | (const uint8_t[]){ 1784 | 0b10100000, 1785 | 0b00000000, 1786 | 0b10100000, 1787 | 0b10100000, 1788 | 0b01100000, 1789 | 0b00000000, 1790 | }, 1791 | // yacute 1792 | (const uint8_t[]){ 1793 | 0b00100000, 1794 | 0b01000000, 1795 | 0b10100000, 1796 | 0b11100000, 1797 | 0b00100000, 1798 | 0b11000000, 1799 | }, 1800 | // thorn 1801 | (const uint8_t[]){ 1802 | 0b10000000, 1803 | 0b10000000, 1804 | 0b11000000, 1805 | 0b10100000, 1806 | 0b11000000, 1807 | 0b10000000, 1808 | }, 1809 | } 1810 | }; -------------------------------------------------------------------------------- /src/Font_5x7.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the ArduinoGraphics library. 3 | Copyright (c) 2019 Arduino SA. All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "../include/Font.h" 21 | 22 | const struct Font Font_5x7 = { 23 | 5, 24 | 7, 25 | (const uint8_t*[]){ 26 | // char0 27 | (const uint8_t[]){ 28 | 0b00000000, 29 | 0b10101000, 30 | 0b00000000, 31 | 0b10001000, 32 | 0b00000000, 33 | 0b10101000, 34 | 0b00000000, 35 | }, 36 | NULL, 37 | NULL, 38 | NULL, 39 | NULL, 40 | NULL, 41 | NULL, 42 | NULL, 43 | NULL, 44 | NULL, 45 | NULL, 46 | NULL, 47 | NULL, 48 | NULL, 49 | NULL, 50 | NULL, 51 | NULL, 52 | NULL, 53 | NULL, 54 | NULL, 55 | NULL, 56 | NULL, 57 | NULL, 58 | NULL, 59 | NULL, 60 | NULL, 61 | NULL, 62 | NULL, 63 | NULL, 64 | NULL, 65 | NULL, 66 | NULL, 67 | // space 68 | (const uint8_t[]){ 69 | 0b00000000, 70 | 0b00000000, 71 | 0b00000000, 72 | 0b00000000, 73 | 0b00000000, 74 | 0b00000000, 75 | 0b00000000, 76 | }, 77 | // exclam 78 | (const uint8_t[]){ 79 | 0b00100000, 80 | 0b00100000, 81 | 0b00100000, 82 | 0b00100000, 83 | 0b00000000, 84 | 0b00100000, 85 | 0b00000000, 86 | }, 87 | // quotedbl 88 | (const uint8_t[]){ 89 | 0b01010000, 90 | 0b01010000, 91 | 0b01010000, 92 | 0b00000000, 93 | 0b00000000, 94 | 0b00000000, 95 | 0b00000000, 96 | }, 97 | // numbersign 98 | (const uint8_t[]){ 99 | 0b00000000, 100 | 0b01010000, 101 | 0b11111000, 102 | 0b01010000, 103 | 0b11111000, 104 | 0b01010000, 105 | 0b00000000, 106 | }, 107 | // dollar 108 | (const uint8_t[]){ 109 | 0b00000000, 110 | 0b01110000, 111 | 0b10100000, 112 | 0b01110000, 113 | 0b00101000, 114 | 0b01110000, 115 | 0b00000000, 116 | }, 117 | // percent 118 | (const uint8_t[]){ 119 | 0b10000000, 120 | 0b10010000, 121 | 0b00100000, 122 | 0b01000000, 123 | 0b10010000, 124 | 0b00010000, 125 | 0b00000000, 126 | }, 127 | // ampersand 128 | (const uint8_t[]){ 129 | 0b00000000, 130 | 0b01000000, 131 | 0b10100000, 132 | 0b01000000, 133 | 0b10100000, 134 | 0b01010000, 135 | 0b00000000, 136 | }, 137 | // quotesingle 138 | (const uint8_t[]){ 139 | 0b00100000, 140 | 0b00100000, 141 | 0b00100000, 142 | 0b00000000, 143 | 0b00000000, 144 | 0b00000000, 145 | 0b00000000, 146 | }, 147 | // parenleft 148 | (const uint8_t[]){ 149 | 0b00100000, 150 | 0b01000000, 151 | 0b01000000, 152 | 0b01000000, 153 | 0b01000000, 154 | 0b00100000, 155 | 0b00000000, 156 | }, 157 | // parenright 158 | (const uint8_t[]){ 159 | 0b01000000, 160 | 0b00100000, 161 | 0b00100000, 162 | 0b00100000, 163 | 0b00100000, 164 | 0b01000000, 165 | 0b00000000, 166 | }, 167 | // asterisk 168 | (const uint8_t[]){ 169 | 0b00000000, 170 | 0b01010000, 171 | 0b00100000, 172 | 0b01110000, 173 | 0b00100000, 174 | 0b01010000, 175 | 0b00000000, 176 | }, 177 | // plus 178 | (const uint8_t[]){ 179 | 0b00000000, 180 | 0b00100000, 181 | 0b00100000, 182 | 0b11111000, 183 | 0b00100000, 184 | 0b00100000, 185 | 0b00000000, 186 | }, 187 | // comma 188 | (const uint8_t[]){ 189 | 0b00000000, 190 | 0b00000000, 191 | 0b00000000, 192 | 0b00000000, 193 | 0b00110000, 194 | 0b00100000, 195 | 0b01000000, 196 | }, 197 | // hyphen 198 | (const uint8_t[]){ 199 | 0b00000000, 200 | 0b00000000, 201 | 0b00000000, 202 | 0b11110000, 203 | 0b00000000, 204 | 0b00000000, 205 | 0b00000000, 206 | }, 207 | // period 208 | (const uint8_t[]){ 209 | 0b00000000, 210 | 0b00000000, 211 | 0b00000000, 212 | 0b00000000, 213 | 0b01100000, 214 | 0b01100000, 215 | 0b00000000, 216 | }, 217 | // slash 218 | (const uint8_t[]){ 219 | 0b00000000, 220 | 0b00010000, 221 | 0b00100000, 222 | 0b01000000, 223 | 0b10000000, 224 | 0b00000000, 225 | 0b00000000, 226 | }, 227 | // zero 228 | (const uint8_t[]){ 229 | 0b00100000, 230 | 0b01010000, 231 | 0b01010000, 232 | 0b01010000, 233 | 0b01010000, 234 | 0b00100000, 235 | 0b00000000, 236 | }, 237 | // one 238 | (const uint8_t[]){ 239 | 0b00100000, 240 | 0b01100000, 241 | 0b00100000, 242 | 0b00100000, 243 | 0b00100000, 244 | 0b01110000, 245 | 0b00000000, 246 | }, 247 | // two 248 | (const uint8_t[]){ 249 | 0b01100000, 250 | 0b10010000, 251 | 0b00010000, 252 | 0b00100000, 253 | 0b01000000, 254 | 0b11110000, 255 | 0b00000000, 256 | }, 257 | // three 258 | (const uint8_t[]){ 259 | 0b11110000, 260 | 0b00010000, 261 | 0b01100000, 262 | 0b00010000, 263 | 0b10010000, 264 | 0b01100000, 265 | 0b00000000, 266 | }, 267 | // four 268 | (const uint8_t[]){ 269 | 0b00100000, 270 | 0b01100000, 271 | 0b10100000, 272 | 0b11110000, 273 | 0b00100000, 274 | 0b00100000, 275 | 0b00000000, 276 | }, 277 | // five 278 | (const uint8_t[]){ 279 | 0b11110000, 280 | 0b10000000, 281 | 0b11100000, 282 | 0b00010000, 283 | 0b10010000, 284 | 0b01100000, 285 | 0b00000000, 286 | }, 287 | // six 288 | (const uint8_t[]){ 289 | 0b01100000, 290 | 0b10000000, 291 | 0b11100000, 292 | 0b10010000, 293 | 0b10010000, 294 | 0b01100000, 295 | 0b00000000, 296 | }, 297 | // seven 298 | (const uint8_t[]){ 299 | 0b11110000, 300 | 0b00010000, 301 | 0b00100000, 302 | 0b00100000, 303 | 0b01000000, 304 | 0b01000000, 305 | 0b00000000, 306 | }, 307 | // eight 308 | (const uint8_t[]){ 309 | 0b01100000, 310 | 0b10010000, 311 | 0b01100000, 312 | 0b10010000, 313 | 0b10010000, 314 | 0b01100000, 315 | 0b00000000, 316 | }, 317 | // nine 318 | (const uint8_t[]){ 319 | 0b01100000, 320 | 0b10010000, 321 | 0b10010000, 322 | 0b01110000, 323 | 0b00010000, 324 | 0b01100000, 325 | 0b00000000, 326 | }, 327 | // colon 328 | (const uint8_t[]){ 329 | 0b00000000, 330 | 0b01100000, 331 | 0b01100000, 332 | 0b00000000, 333 | 0b01100000, 334 | 0b01100000, 335 | 0b00000000, 336 | }, 337 | // semicolon 338 | (const uint8_t[]){ 339 | 0b00000000, 340 | 0b01100000, 341 | 0b01100000, 342 | 0b00000000, 343 | 0b01100000, 344 | 0b01000000, 345 | 0b10000000, 346 | }, 347 | // less 348 | (const uint8_t[]){ 349 | 0b00000000, 350 | 0b00010000, 351 | 0b00100000, 352 | 0b01000000, 353 | 0b00100000, 354 | 0b00010000, 355 | 0b00000000, 356 | }, 357 | // equal 358 | (const uint8_t[]){ 359 | 0b00000000, 360 | 0b00000000, 361 | 0b11110000, 362 | 0b00000000, 363 | 0b11110000, 364 | 0b00000000, 365 | 0b00000000, 366 | }, 367 | // greater 368 | (const uint8_t[]){ 369 | 0b00000000, 370 | 0b01000000, 371 | 0b00100000, 372 | 0b00010000, 373 | 0b00100000, 374 | 0b01000000, 375 | 0b00000000, 376 | }, 377 | // question 378 | (const uint8_t[]){ 379 | 0b00100000, 380 | 0b01010000, 381 | 0b00010000, 382 | 0b00100000, 383 | 0b00000000, 384 | 0b00100000, 385 | 0b00000000, 386 | }, 387 | // at 388 | (const uint8_t[]){ 389 | 0b01100000, 390 | 0b10010000, 391 | 0b10110000, 392 | 0b10110000, 393 | 0b10000000, 394 | 0b01100000, 395 | 0b00000000, 396 | }, 397 | // A 398 | (const uint8_t[]){ 399 | 0b01100000, 400 | 0b10010000, 401 | 0b10010000, 402 | 0b11110000, 403 | 0b10010000, 404 | 0b10010000, 405 | 0b00000000, 406 | }, 407 | // B 408 | (const uint8_t[]){ 409 | 0b11100000, 410 | 0b10010000, 411 | 0b11100000, 412 | 0b10010000, 413 | 0b10010000, 414 | 0b11100000, 415 | 0b00000000, 416 | }, 417 | // C 418 | (const uint8_t[]){ 419 | 0b01100000, 420 | 0b10010000, 421 | 0b10000000, 422 | 0b10000000, 423 | 0b10010000, 424 | 0b01100000, 425 | 0b00000000, 426 | }, 427 | // D 428 | (const uint8_t[]){ 429 | 0b11100000, 430 | 0b10010000, 431 | 0b10010000, 432 | 0b10010000, 433 | 0b10010000, 434 | 0b11100000, 435 | 0b00000000, 436 | }, 437 | // E 438 | (const uint8_t[]){ 439 | 0b11110000, 440 | 0b10000000, 441 | 0b11100000, 442 | 0b10000000, 443 | 0b10000000, 444 | 0b11110000, 445 | 0b00000000, 446 | }, 447 | // F 448 | (const uint8_t[]){ 449 | 0b11110000, 450 | 0b10000000, 451 | 0b11100000, 452 | 0b10000000, 453 | 0b10000000, 454 | 0b10000000, 455 | 0b00000000, 456 | }, 457 | // G 458 | (const uint8_t[]){ 459 | 0b01100000, 460 | 0b10010000, 461 | 0b10000000, 462 | 0b10110000, 463 | 0b10010000, 464 | 0b01110000, 465 | 0b00000000, 466 | }, 467 | // H 468 | (const uint8_t[]){ 469 | 0b10010000, 470 | 0b10010000, 471 | 0b11110000, 472 | 0b10010000, 473 | 0b10010000, 474 | 0b10010000, 475 | 0b00000000, 476 | }, 477 | // I 478 | (const uint8_t[]){ 479 | 0b01110000, 480 | 0b00100000, 481 | 0b00100000, 482 | 0b00100000, 483 | 0b00100000, 484 | 0b01110000, 485 | 0b00000000, 486 | }, 487 | // J 488 | (const uint8_t[]){ 489 | 0b00010000, 490 | 0b00010000, 491 | 0b00010000, 492 | 0b00010000, 493 | 0b10010000, 494 | 0b01100000, 495 | 0b00000000, 496 | }, 497 | // K 498 | (const uint8_t[]){ 499 | 0b10010000, 500 | 0b10100000, 501 | 0b11000000, 502 | 0b11000000, 503 | 0b10100000, 504 | 0b10010000, 505 | 0b00000000, 506 | }, 507 | // L 508 | (const uint8_t[]){ 509 | 0b10000000, 510 | 0b10000000, 511 | 0b10000000, 512 | 0b10000000, 513 | 0b10000000, 514 | 0b11110000, 515 | 0b00000000, 516 | }, 517 | // M 518 | (const uint8_t[]){ 519 | 0b10010000, 520 | 0b11110000, 521 | 0b11110000, 522 | 0b10010000, 523 | 0b10010000, 524 | 0b10010000, 525 | 0b00000000, 526 | }, 527 | // N 528 | (const uint8_t[]){ 529 | 0b10010000, 530 | 0b11010000, 531 | 0b11010000, 532 | 0b10110000, 533 | 0b10110000, 534 | 0b10010000, 535 | 0b00000000, 536 | }, 537 | // O 538 | (const uint8_t[]){ 539 | 0b01100000, 540 | 0b10010000, 541 | 0b10010000, 542 | 0b10010000, 543 | 0b10010000, 544 | 0b01100000, 545 | 0b00000000, 546 | }, 547 | // P 548 | (const uint8_t[]){ 549 | 0b11100000, 550 | 0b10010000, 551 | 0b10010000, 552 | 0b11100000, 553 | 0b10000000, 554 | 0b10000000, 555 | 0b00000000, 556 | }, 557 | // Q 558 | (const uint8_t[]){ 559 | 0b01100000, 560 | 0b10010000, 561 | 0b10010000, 562 | 0b10010000, 563 | 0b11010000, 564 | 0b01100000, 565 | 0b00010000, 566 | }, 567 | // R 568 | (const uint8_t[]){ 569 | 0b11100000, 570 | 0b10010000, 571 | 0b10010000, 572 | 0b11100000, 573 | 0b10100000, 574 | 0b10010000, 575 | 0b00000000, 576 | }, 577 | // S 578 | (const uint8_t[]){ 579 | 0b01100000, 580 | 0b10010000, 581 | 0b01000000, 582 | 0b00100000, 583 | 0b10010000, 584 | 0b01100000, 585 | 0b00000000, 586 | }, 587 | // T 588 | (const uint8_t[]){ 589 | 0b01110000, 590 | 0b00100000, 591 | 0b00100000, 592 | 0b00100000, 593 | 0b00100000, 594 | 0b00100000, 595 | 0b00000000, 596 | }, 597 | // U 598 | (const uint8_t[]){ 599 | 0b10010000, 600 | 0b10010000, 601 | 0b10010000, 602 | 0b10010000, 603 | 0b10010000, 604 | 0b01100000, 605 | 0b00000000, 606 | }, 607 | // V 608 | (const uint8_t[]){ 609 | 0b10010000, 610 | 0b10010000, 611 | 0b10010000, 612 | 0b10010000, 613 | 0b01100000, 614 | 0b01100000, 615 | 0b00000000, 616 | }, 617 | // W 618 | (const uint8_t[]){ 619 | 0b10010000, 620 | 0b10010000, 621 | 0b10010000, 622 | 0b11110000, 623 | 0b11110000, 624 | 0b10010000, 625 | 0b00000000, 626 | }, 627 | // X 628 | (const uint8_t[]){ 629 | 0b10010000, 630 | 0b10010000, 631 | 0b01100000, 632 | 0b01100000, 633 | 0b10010000, 634 | 0b10010000, 635 | 0b00000000, 636 | }, 637 | // Y 638 | (const uint8_t[]){ 639 | 0b01010000, 640 | 0b01010000, 641 | 0b01010000, 642 | 0b00100000, 643 | 0b00100000, 644 | 0b00100000, 645 | 0b00000000, 646 | }, 647 | // Z 648 | (const uint8_t[]){ 649 | 0b11110000, 650 | 0b00010000, 651 | 0b00100000, 652 | 0b01000000, 653 | 0b10000000, 654 | 0b11110000, 655 | 0b00000000, 656 | }, 657 | // bracketleft 658 | (const uint8_t[]){ 659 | 0b01110000, 660 | 0b01000000, 661 | 0b01000000, 662 | 0b01000000, 663 | 0b01000000, 664 | 0b01110000, 665 | 0b00000000, 666 | }, 667 | // backslash 668 | (const uint8_t[]){ 669 | 0b00000000, 670 | 0b10000000, 671 | 0b01000000, 672 | 0b00100000, 673 | 0b00010000, 674 | 0b00000000, 675 | 0b00000000, 676 | }, 677 | // bracketright 678 | (const uint8_t[]){ 679 | 0b01110000, 680 | 0b00010000, 681 | 0b00010000, 682 | 0b00010000, 683 | 0b00010000, 684 | 0b01110000, 685 | 0b00000000, 686 | }, 687 | // asciicircum 688 | (const uint8_t[]){ 689 | 0b00100000, 690 | 0b01010000, 691 | 0b00000000, 692 | 0b00000000, 693 | 0b00000000, 694 | 0b00000000, 695 | 0b00000000, 696 | }, 697 | // underscore 698 | (const uint8_t[]){ 699 | 0b00000000, 700 | 0b00000000, 701 | 0b00000000, 702 | 0b00000000, 703 | 0b00000000, 704 | 0b11110000, 705 | 0b00000000, 706 | }, 707 | // grave 708 | (const uint8_t[]){ 709 | 0b01000000, 710 | 0b00100000, 711 | 0b00000000, 712 | 0b00000000, 713 | 0b00000000, 714 | 0b00000000, 715 | 0b00000000, 716 | }, 717 | // a 718 | (const uint8_t[]){ 719 | 0b00000000, 720 | 0b00000000, 721 | 0b01110000, 722 | 0b10010000, 723 | 0b10110000, 724 | 0b01010000, 725 | 0b00000000, 726 | }, 727 | // b 728 | (const uint8_t[]){ 729 | 0b10000000, 730 | 0b10000000, 731 | 0b11100000, 732 | 0b10010000, 733 | 0b10010000, 734 | 0b11100000, 735 | 0b00000000, 736 | }, 737 | // c 738 | (const uint8_t[]){ 739 | 0b00000000, 740 | 0b00000000, 741 | 0b01100000, 742 | 0b10000000, 743 | 0b10000000, 744 | 0b01100000, 745 | 0b00000000, 746 | }, 747 | // d 748 | (const uint8_t[]){ 749 | 0b00010000, 750 | 0b00010000, 751 | 0b01110000, 752 | 0b10010000, 753 | 0b10010000, 754 | 0b01110000, 755 | 0b00000000, 756 | }, 757 | // e 758 | (const uint8_t[]){ 759 | 0b00000000, 760 | 0b00000000, 761 | 0b01100000, 762 | 0b10110000, 763 | 0b11000000, 764 | 0b01100000, 765 | 0b00000000, 766 | }, 767 | // f 768 | (const uint8_t[]){ 769 | 0b00100000, 770 | 0b01010000, 771 | 0b01000000, 772 | 0b11100000, 773 | 0b01000000, 774 | 0b01000000, 775 | 0b00000000, 776 | }, 777 | // g 778 | (const uint8_t[]){ 779 | 0b00000000, 780 | 0b00000000, 781 | 0b01110000, 782 | 0b10010000, 783 | 0b01100000, 784 | 0b10000000, 785 | 0b01110000, 786 | }, 787 | // h 788 | (const uint8_t[]){ 789 | 0b10000000, 790 | 0b10000000, 791 | 0b11100000, 792 | 0b10010000, 793 | 0b10010000, 794 | 0b10010000, 795 | 0b00000000, 796 | }, 797 | // i 798 | (const uint8_t[]){ 799 | 0b00100000, 800 | 0b00000000, 801 | 0b01100000, 802 | 0b00100000, 803 | 0b00100000, 804 | 0b01110000, 805 | 0b00000000, 806 | }, 807 | // j 808 | (const uint8_t[]){ 809 | 0b00010000, 810 | 0b00000000, 811 | 0b00010000, 812 | 0b00010000, 813 | 0b00010000, 814 | 0b01010000, 815 | 0b00100000, 816 | }, 817 | // k 818 | (const uint8_t[]){ 819 | 0b10000000, 820 | 0b10000000, 821 | 0b10100000, 822 | 0b11000000, 823 | 0b10100000, 824 | 0b10010000, 825 | 0b00000000, 826 | }, 827 | // l 828 | (const uint8_t[]){ 829 | 0b01100000, 830 | 0b00100000, 831 | 0b00100000, 832 | 0b00100000, 833 | 0b00100000, 834 | 0b01110000, 835 | 0b00000000, 836 | }, 837 | // m 838 | (const uint8_t[]){ 839 | 0b00000000, 840 | 0b00000000, 841 | 0b10100000, 842 | 0b11110000, 843 | 0b10010000, 844 | 0b10010000, 845 | 0b00000000, 846 | }, 847 | // n 848 | (const uint8_t[]){ 849 | 0b00000000, 850 | 0b00000000, 851 | 0b11100000, 852 | 0b10010000, 853 | 0b10010000, 854 | 0b10010000, 855 | 0b00000000, 856 | }, 857 | // o 858 | (const uint8_t[]){ 859 | 0b00000000, 860 | 0b00000000, 861 | 0b01100000, 862 | 0b10010000, 863 | 0b10010000, 864 | 0b01100000, 865 | 0b00000000, 866 | }, 867 | // p 868 | (const uint8_t[]){ 869 | 0b00000000, 870 | 0b00000000, 871 | 0b11100000, 872 | 0b10010000, 873 | 0b10010000, 874 | 0b11100000, 875 | 0b10000000, 876 | }, 877 | // q 878 | (const uint8_t[]){ 879 | 0b00000000, 880 | 0b00000000, 881 | 0b01110000, 882 | 0b10010000, 883 | 0b10010000, 884 | 0b01110000, 885 | 0b00010000, 886 | }, 887 | // r 888 | (const uint8_t[]){ 889 | 0b00000000, 890 | 0b00000000, 891 | 0b11100000, 892 | 0b10010000, 893 | 0b10000000, 894 | 0b10000000, 895 | 0b00000000, 896 | }, 897 | // s 898 | (const uint8_t[]){ 899 | 0b00000000, 900 | 0b00000000, 901 | 0b01110000, 902 | 0b11000000, 903 | 0b00110000, 904 | 0b11100000, 905 | 0b00000000, 906 | }, 907 | // t 908 | (const uint8_t[]){ 909 | 0b01000000, 910 | 0b01000000, 911 | 0b11100000, 912 | 0b01000000, 913 | 0b01000000, 914 | 0b00110000, 915 | 0b00000000, 916 | }, 917 | // u 918 | (const uint8_t[]){ 919 | 0b00000000, 920 | 0b00000000, 921 | 0b10010000, 922 | 0b10010000, 923 | 0b10010000, 924 | 0b01110000, 925 | 0b00000000, 926 | }, 927 | // v 928 | (const uint8_t[]){ 929 | 0b00000000, 930 | 0b00000000, 931 | 0b01010000, 932 | 0b01010000, 933 | 0b01010000, 934 | 0b00100000, 935 | 0b00000000, 936 | }, 937 | // w 938 | (const uint8_t[]){ 939 | 0b00000000, 940 | 0b00000000, 941 | 0b10010000, 942 | 0b10010000, 943 | 0b11110000, 944 | 0b11110000, 945 | 0b00000000, 946 | }, 947 | // x 948 | (const uint8_t[]){ 949 | 0b00000000, 950 | 0b00000000, 951 | 0b10010000, 952 | 0b01100000, 953 | 0b01100000, 954 | 0b10010000, 955 | 0b00000000, 956 | }, 957 | // y 958 | (const uint8_t[]){ 959 | 0b00000000, 960 | 0b00000000, 961 | 0b10010000, 962 | 0b10010000, 963 | 0b01010000, 964 | 0b00100000, 965 | 0b01000000, 966 | }, 967 | // z 968 | (const uint8_t[]){ 969 | 0b00000000, 970 | 0b00000000, 971 | 0b11110000, 972 | 0b00100000, 973 | 0b01000000, 974 | 0b11110000, 975 | 0b00000000, 976 | }, 977 | // braceleft 978 | (const uint8_t[]){ 979 | 0b00010000, 980 | 0b00100000, 981 | 0b01100000, 982 | 0b00100000, 983 | 0b00100000, 984 | 0b00010000, 985 | 0b00000000, 986 | }, 987 | // bar 988 | (const uint8_t[]){ 989 | 0b00100000, 990 | 0b00100000, 991 | 0b00100000, 992 | 0b00100000, 993 | 0b00100000, 994 | 0b00100000, 995 | 0b00000000, 996 | }, 997 | // braceright 998 | (const uint8_t[]){ 999 | 0b01000000, 1000 | 0b00100000, 1001 | 0b00110000, 1002 | 0b00100000, 1003 | 0b00100000, 1004 | 0b01000000, 1005 | 0b00000000, 1006 | }, 1007 | // asciitilde 1008 | (const uint8_t[]){ 1009 | 0b01010000, 1010 | 0b10100000, 1011 | 0b00000000, 1012 | 0b00000000, 1013 | 0b00000000, 1014 | 0b00000000, 1015 | 0b00000000, 1016 | }, 1017 | NULL, 1018 | NULL, 1019 | NULL, 1020 | NULL, 1021 | NULL, 1022 | NULL, 1023 | NULL, 1024 | NULL, 1025 | NULL, 1026 | NULL, 1027 | NULL, 1028 | NULL, 1029 | NULL, 1030 | NULL, 1031 | NULL, 1032 | NULL, 1033 | NULL, 1034 | NULL, 1035 | NULL, 1036 | NULL, 1037 | NULL, 1038 | NULL, 1039 | NULL, 1040 | NULL, 1041 | NULL, 1042 | NULL, 1043 | NULL, 1044 | NULL, 1045 | NULL, 1046 | NULL, 1047 | NULL, 1048 | NULL, 1049 | NULL, 1050 | // space 1051 | (const uint8_t[]){ 1052 | 0b00000000, 1053 | 0b00000000, 1054 | 0b00000000, 1055 | 0b00000000, 1056 | 0b00000000, 1057 | 0b00000000, 1058 | 0b00000000, 1059 | }, 1060 | // exclamdown 1061 | (const uint8_t[]){ 1062 | 0b00100000, 1063 | 0b00000000, 1064 | 0b00100000, 1065 | 0b00100000, 1066 | 0b00100000, 1067 | 0b00100000, 1068 | 0b00000000, 1069 | }, 1070 | // cent 1071 | (const uint8_t[]){ 1072 | 0b00000000, 1073 | 0b00100000, 1074 | 0b01110000, 1075 | 0b10100000, 1076 | 0b10100000, 1077 | 0b01110000, 1078 | 0b00100000, 1079 | }, 1080 | // sterling 1081 | (const uint8_t[]){ 1082 | 0b00000000, 1083 | 0b00110000, 1084 | 0b01000000, 1085 | 0b11100000, 1086 | 0b01000000, 1087 | 0b10110000, 1088 | 0b00000000, 1089 | }, 1090 | // currency 1091 | (const uint8_t[]){ 1092 | 0b00000000, 1093 | 0b10001000, 1094 | 0b01110000, 1095 | 0b01010000, 1096 | 0b01110000, 1097 | 0b10001000, 1098 | 0b00000000, 1099 | }, 1100 | // yen 1101 | (const uint8_t[]){ 1102 | 0b01010000, 1103 | 0b01010000, 1104 | 0b00100000, 1105 | 0b01110000, 1106 | 0b00100000, 1107 | 0b00100000, 1108 | 0b00000000, 1109 | }, 1110 | // brokenbar 1111 | (const uint8_t[]){ 1112 | 0b00000000, 1113 | 0b00100000, 1114 | 0b00100000, 1115 | 0b00000000, 1116 | 0b00100000, 1117 | 0b00100000, 1118 | 0b00000000, 1119 | }, 1120 | // section 1121 | (const uint8_t[]){ 1122 | 0b00110000, 1123 | 0b01000000, 1124 | 0b01100000, 1125 | 0b01010000, 1126 | 0b00110000, 1127 | 0b00010000, 1128 | 0b01100000, 1129 | }, 1130 | // dieresis 1131 | (const uint8_t[]){ 1132 | 0b01010000, 1133 | 0b00000000, 1134 | 0b00000000, 1135 | 0b00000000, 1136 | 0b00000000, 1137 | 0b00000000, 1138 | 0b00000000, 1139 | }, 1140 | // copyright 1141 | (const uint8_t[]){ 1142 | 0b01110000, 1143 | 0b10001000, 1144 | 0b10101000, 1145 | 0b11001000, 1146 | 0b10101000, 1147 | 0b10001000, 1148 | 0b01110000, 1149 | }, 1150 | // ordfeminine 1151 | (const uint8_t[]){ 1152 | 0b01100000, 1153 | 0b10100000, 1154 | 0b01100000, 1155 | 0b00000000, 1156 | 0b00000000, 1157 | 0b00000000, 1158 | 0b00000000, 1159 | }, 1160 | // guillemotleft 1161 | (const uint8_t[]){ 1162 | 0b00000000, 1163 | 0b00000000, 1164 | 0b01001000, 1165 | 0b10010000, 1166 | 0b01001000, 1167 | 0b00000000, 1168 | 0b00000000, 1169 | }, 1170 | // logicalnot 1171 | (const uint8_t[]){ 1172 | 0b00000000, 1173 | 0b00000000, 1174 | 0b00000000, 1175 | 0b11110000, 1176 | 0b00010000, 1177 | 0b00000000, 1178 | 0b00000000, 1179 | }, 1180 | // hyphen 1181 | (const uint8_t[]){ 1182 | 0b00000000, 1183 | 0b00000000, 1184 | 0b00000000, 1185 | 0b01110000, 1186 | 0b00000000, 1187 | 0b00000000, 1188 | 0b00000000, 1189 | }, 1190 | // registered 1191 | (const uint8_t[]){ 1192 | 0b01110000, 1193 | 0b10001000, 1194 | 0b11101000, 1195 | 0b11001000, 1196 | 0b11001000, 1197 | 0b10001000, 1198 | 0b01110000, 1199 | }, 1200 | // macron 1201 | (const uint8_t[]){ 1202 | 0b11110000, 1203 | 0b00000000, 1204 | 0b00000000, 1205 | 0b00000000, 1206 | 0b00000000, 1207 | 0b00000000, 1208 | 0b00000000, 1209 | }, 1210 | // degree 1211 | (const uint8_t[]){ 1212 | 0b00100000, 1213 | 0b01010000, 1214 | 0b00100000, 1215 | 0b00000000, 1216 | 0b00000000, 1217 | 0b00000000, 1218 | 0b00000000, 1219 | }, 1220 | // plusminus 1221 | (const uint8_t[]){ 1222 | 0b00100000, 1223 | 0b00100000, 1224 | 0b11111000, 1225 | 0b00100000, 1226 | 0b00100000, 1227 | 0b11111000, 1228 | 0b00000000, 1229 | }, 1230 | // twosuperior 1231 | (const uint8_t[]){ 1232 | 0b01100000, 1233 | 0b00100000, 1234 | 0b01000000, 1235 | 0b01100000, 1236 | 0b00000000, 1237 | 0b00000000, 1238 | 0b00000000, 1239 | }, 1240 | // threesuperior 1241 | (const uint8_t[]){ 1242 | 0b01100000, 1243 | 0b01100000, 1244 | 0b00100000, 1245 | 0b01100000, 1246 | 0b00000000, 1247 | 0b00000000, 1248 | 0b00000000, 1249 | }, 1250 | // acute 1251 | (const uint8_t[]){ 1252 | 0b00100000, 1253 | 0b01000000, 1254 | 0b00000000, 1255 | 0b00000000, 1256 | 0b00000000, 1257 | 0b00000000, 1258 | 0b00000000, 1259 | }, 1260 | // mu 1261 | (const uint8_t[]){ 1262 | 0b00000000, 1263 | 0b00000000, 1264 | 0b10010000, 1265 | 0b10010000, 1266 | 0b10010000, 1267 | 0b11100000, 1268 | 0b10000000, 1269 | }, 1270 | // paragraph 1271 | (const uint8_t[]){ 1272 | 0b01110000, 1273 | 0b11010000, 1274 | 0b11010000, 1275 | 0b01010000, 1276 | 0b01010000, 1277 | 0b01010000, 1278 | 0b00000000, 1279 | }, 1280 | // periodcentered 1281 | (const uint8_t[]){ 1282 | 0b00000000, 1283 | 0b00000000, 1284 | 0b01100000, 1285 | 0b01100000, 1286 | 0b00000000, 1287 | 0b00000000, 1288 | 0b00000000, 1289 | }, 1290 | // cedilla 1291 | (const uint8_t[]){ 1292 | 0b00000000, 1293 | 0b00000000, 1294 | 0b00000000, 1295 | 0b00000000, 1296 | 0b00000000, 1297 | 0b00100000, 1298 | 0b01000000, 1299 | }, 1300 | // onesuperior 1301 | (const uint8_t[]){ 1302 | 0b00100000, 1303 | 0b01100000, 1304 | 0b00100000, 1305 | 0b01110000, 1306 | 0b00000000, 1307 | 0b00000000, 1308 | 0b00000000, 1309 | }, 1310 | // ordmasculine 1311 | (const uint8_t[]){ 1312 | 0b01000000, 1313 | 0b10100000, 1314 | 0b01000000, 1315 | 0b00000000, 1316 | 0b00000000, 1317 | 0b00000000, 1318 | 0b00000000, 1319 | }, 1320 | // guillemotright 1321 | (const uint8_t[]){ 1322 | 0b00000000, 1323 | 0b00000000, 1324 | 0b10010000, 1325 | 0b01001000, 1326 | 0b10010000, 1327 | 0b00000000, 1328 | 0b00000000, 1329 | }, 1330 | // onequarter 1331 | (const uint8_t[]){ 1332 | 0b10000000, 1333 | 0b10000000, 1334 | 0b10000000, 1335 | 0b10010000, 1336 | 0b00110000, 1337 | 0b01110000, 1338 | 0b00010000, 1339 | }, 1340 | // onehalf 1341 | (const uint8_t[]){ 1342 | 0b10000000, 1343 | 0b10000000, 1344 | 0b10000000, 1345 | 0b10110000, 1346 | 0b00010000, 1347 | 0b00100000, 1348 | 0b00110000, 1349 | }, 1350 | // threequarters 1351 | (const uint8_t[]){ 1352 | 0b11000000, 1353 | 0b11000000, 1354 | 0b01000000, 1355 | 0b11010000, 1356 | 0b00110000, 1357 | 0b01110000, 1358 | 0b00010000, 1359 | }, 1360 | // questiondown 1361 | (const uint8_t[]){ 1362 | 0b00100000, 1363 | 0b00000000, 1364 | 0b00100000, 1365 | 0b01000000, 1366 | 0b01010000, 1367 | 0b00100000, 1368 | 0b00000000, 1369 | }, 1370 | // Agrave 1371 | (const uint8_t[]){ 1372 | 0b01100000, 1373 | 0b10010000, 1374 | 0b10010000, 1375 | 0b11110000, 1376 | 0b10010000, 1377 | 0b10010000, 1378 | 0b00000000, 1379 | }, 1380 | // Aacute 1381 | (const uint8_t[]){ 1382 | 0b01100000, 1383 | 0b10010000, 1384 | 0b10010000, 1385 | 0b11110000, 1386 | 0b10010000, 1387 | 0b10010000, 1388 | 0b00000000, 1389 | }, 1390 | // Acircumflex 1391 | (const uint8_t[]){ 1392 | 0b01100000, 1393 | 0b10010000, 1394 | 0b10010000, 1395 | 0b11110000, 1396 | 0b10010000, 1397 | 0b10010000, 1398 | 0b00000000, 1399 | }, 1400 | // Atilde 1401 | (const uint8_t[]){ 1402 | 0b01100000, 1403 | 0b10010000, 1404 | 0b10010000, 1405 | 0b11110000, 1406 | 0b10010000, 1407 | 0b10010000, 1408 | 0b00000000, 1409 | }, 1410 | // Adieresis 1411 | (const uint8_t[]){ 1412 | 0b10010000, 1413 | 0b01100000, 1414 | 0b10010000, 1415 | 0b11110000, 1416 | 0b10010000, 1417 | 0b10010000, 1418 | 0b00000000, 1419 | }, 1420 | // Aring 1421 | (const uint8_t[]){ 1422 | 0b01100000, 1423 | 0b01100000, 1424 | 0b10010000, 1425 | 0b11110000, 1426 | 0b10010000, 1427 | 0b10010000, 1428 | 0b00000000, 1429 | }, 1430 | // AE 1431 | (const uint8_t[]){ 1432 | 0b01110000, 1433 | 0b10100000, 1434 | 0b10110000, 1435 | 0b11100000, 1436 | 0b10100000, 1437 | 0b10110000, 1438 | 0b00000000, 1439 | }, 1440 | // Ccedilla 1441 | (const uint8_t[]){ 1442 | 0b01100000, 1443 | 0b10010000, 1444 | 0b10000000, 1445 | 0b10000000, 1446 | 0b10010000, 1447 | 0b01100000, 1448 | 0b01000000, 1449 | }, 1450 | // Egrave 1451 | (const uint8_t[]){ 1452 | 0b11110000, 1453 | 0b10000000, 1454 | 0b11100000, 1455 | 0b10000000, 1456 | 0b10000000, 1457 | 0b11110000, 1458 | 0b00000000, 1459 | }, 1460 | // Eacute 1461 | (const uint8_t[]){ 1462 | 0b11110000, 1463 | 0b10000000, 1464 | 0b11100000, 1465 | 0b10000000, 1466 | 0b10000000, 1467 | 0b11110000, 1468 | 0b00000000, 1469 | }, 1470 | // Ecircumflex 1471 | (const uint8_t[]){ 1472 | 0b11110000, 1473 | 0b10000000, 1474 | 0b11100000, 1475 | 0b10000000, 1476 | 0b10000000, 1477 | 0b11110000, 1478 | 0b00000000, 1479 | }, 1480 | // Edieresis 1481 | (const uint8_t[]){ 1482 | 0b11110000, 1483 | 0b10000000, 1484 | 0b11100000, 1485 | 0b10000000, 1486 | 0b10000000, 1487 | 0b11110000, 1488 | 0b00000000, 1489 | }, 1490 | // Igrave 1491 | (const uint8_t[]){ 1492 | 0b01110000, 1493 | 0b00100000, 1494 | 0b00100000, 1495 | 0b00100000, 1496 | 0b00100000, 1497 | 0b01110000, 1498 | 0b00000000, 1499 | }, 1500 | // Iacute 1501 | (const uint8_t[]){ 1502 | 0b01110000, 1503 | 0b00100000, 1504 | 0b00100000, 1505 | 0b00100000, 1506 | 0b00100000, 1507 | 0b01110000, 1508 | 0b00000000, 1509 | }, 1510 | // Icircumflex 1511 | (const uint8_t[]){ 1512 | 0b01110000, 1513 | 0b00100000, 1514 | 0b00100000, 1515 | 0b00100000, 1516 | 0b00100000, 1517 | 0b01110000, 1518 | 0b00000000, 1519 | }, 1520 | // Idieresis 1521 | (const uint8_t[]){ 1522 | 0b01110000, 1523 | 0b00100000, 1524 | 0b00100000, 1525 | 0b00100000, 1526 | 0b00100000, 1527 | 0b01110000, 1528 | 0b00000000, 1529 | }, 1530 | // Eth 1531 | (const uint8_t[]){ 1532 | 0b11100000, 1533 | 0b01010000, 1534 | 0b11010000, 1535 | 0b01010000, 1536 | 0b01010000, 1537 | 0b11100000, 1538 | 0b00000000, 1539 | }, 1540 | // Ntilde 1541 | (const uint8_t[]){ 1542 | 0b10110000, 1543 | 0b10010000, 1544 | 0b11010000, 1545 | 0b10110000, 1546 | 0b10110000, 1547 | 0b10010000, 1548 | 0b00000000, 1549 | }, 1550 | // Ograve 1551 | (const uint8_t[]){ 1552 | 0b01100000, 1553 | 0b10010000, 1554 | 0b10010000, 1555 | 0b10010000, 1556 | 0b10010000, 1557 | 0b01100000, 1558 | 0b00000000, 1559 | }, 1560 | // Oacute 1561 | (const uint8_t[]){ 1562 | 0b01100000, 1563 | 0b10010000, 1564 | 0b10010000, 1565 | 0b10010000, 1566 | 0b10010000, 1567 | 0b01100000, 1568 | 0b00000000, 1569 | }, 1570 | // Ocircumflex 1571 | (const uint8_t[]){ 1572 | 0b01100000, 1573 | 0b10010000, 1574 | 0b10010000, 1575 | 0b10010000, 1576 | 0b10010000, 1577 | 0b01100000, 1578 | 0b00000000, 1579 | }, 1580 | // Otilde 1581 | (const uint8_t[]){ 1582 | 0b01100000, 1583 | 0b10010000, 1584 | 0b10010000, 1585 | 0b10010000, 1586 | 0b10010000, 1587 | 0b01100000, 1588 | 0b00000000, 1589 | }, 1590 | // Odieresis 1591 | (const uint8_t[]){ 1592 | 0b10010000, 1593 | 0b01100000, 1594 | 0b10010000, 1595 | 0b10010000, 1596 | 0b10010000, 1597 | 0b01100000, 1598 | 0b00000000, 1599 | }, 1600 | // multiply 1601 | (const uint8_t[]){ 1602 | 0b00000000, 1603 | 0b00000000, 1604 | 0b10010000, 1605 | 0b01100000, 1606 | 0b01100000, 1607 | 0b10010000, 1608 | 0b00000000, 1609 | }, 1610 | // Oslash 1611 | (const uint8_t[]){ 1612 | 0b01110000, 1613 | 0b10110000, 1614 | 0b10110000, 1615 | 0b11010000, 1616 | 0b11010000, 1617 | 0b11100000, 1618 | 0b00000000, 1619 | }, 1620 | // Ugrave 1621 | (const uint8_t[]){ 1622 | 0b10010000, 1623 | 0b10010000, 1624 | 0b10010000, 1625 | 0b10010000, 1626 | 0b10010000, 1627 | 0b01100000, 1628 | 0b00000000, 1629 | }, 1630 | // Uacute 1631 | (const uint8_t[]){ 1632 | 0b10010000, 1633 | 0b10010000, 1634 | 0b10010000, 1635 | 0b10010000, 1636 | 0b10010000, 1637 | 0b01100000, 1638 | 0b00000000, 1639 | }, 1640 | // Ucircumflex 1641 | (const uint8_t[]){ 1642 | 0b10010000, 1643 | 0b10010000, 1644 | 0b10010000, 1645 | 0b10010000, 1646 | 0b10010000, 1647 | 0b01100000, 1648 | 0b00000000, 1649 | }, 1650 | // Udieresis 1651 | (const uint8_t[]){ 1652 | 0b10010000, 1653 | 0b00000000, 1654 | 0b10010000, 1655 | 0b10010000, 1656 | 0b10010000, 1657 | 0b01100000, 1658 | 0b00000000, 1659 | }, 1660 | // Yacute 1661 | (const uint8_t[]){ 1662 | 0b01010000, 1663 | 0b01010000, 1664 | 0b01010000, 1665 | 0b00100000, 1666 | 0b00100000, 1667 | 0b00100000, 1668 | 0b00000000, 1669 | }, 1670 | // Thorn 1671 | (const uint8_t[]){ 1672 | 0b10000000, 1673 | 0b11100000, 1674 | 0b10010000, 1675 | 0b11100000, 1676 | 0b10000000, 1677 | 0b10000000, 1678 | 0b00000000, 1679 | }, 1680 | // germandbls 1681 | (const uint8_t[]){ 1682 | 0b01100000, 1683 | 0b10010000, 1684 | 0b10100000, 1685 | 0b10010000, 1686 | 0b10010000, 1687 | 0b10100000, 1688 | 0b00000000, 1689 | }, 1690 | // agrave 1691 | (const uint8_t[]){ 1692 | 0b01000000, 1693 | 0b00100000, 1694 | 0b01110000, 1695 | 0b10010000, 1696 | 0b10110000, 1697 | 0b01010000, 1698 | 0b00000000, 1699 | }, 1700 | // aacute 1701 | (const uint8_t[]){ 1702 | 0b00100000, 1703 | 0b01000000, 1704 | 0b01110000, 1705 | 0b10010000, 1706 | 0b10110000, 1707 | 0b01010000, 1708 | 0b00000000, 1709 | }, 1710 | // acircumflex 1711 | (const uint8_t[]){ 1712 | 0b00100000, 1713 | 0b01010000, 1714 | 0b01110000, 1715 | 0b10010000, 1716 | 0b10110000, 1717 | 0b01010000, 1718 | 0b00000000, 1719 | }, 1720 | // atilde 1721 | (const uint8_t[]){ 1722 | 0b01010000, 1723 | 0b10100000, 1724 | 0b01110000, 1725 | 0b10010000, 1726 | 0b10110000, 1727 | 0b01010000, 1728 | 0b00000000, 1729 | }, 1730 | // adieresis 1731 | (const uint8_t[]){ 1732 | 0b01010000, 1733 | 0b00000000, 1734 | 0b01110000, 1735 | 0b10010000, 1736 | 0b10110000, 1737 | 0b01010000, 1738 | 0b00000000, 1739 | }, 1740 | // aring 1741 | (const uint8_t[]){ 1742 | 0b01100000, 1743 | 0b01100000, 1744 | 0b01110000, 1745 | 0b10010000, 1746 | 0b10110000, 1747 | 0b01010000, 1748 | 0b00000000, 1749 | }, 1750 | // ae 1751 | (const uint8_t[]){ 1752 | 0b00000000, 1753 | 0b00000000, 1754 | 0b01110000, 1755 | 0b10110000, 1756 | 0b10100000, 1757 | 0b01110000, 1758 | 0b00000000, 1759 | }, 1760 | // ccedilla 1761 | (const uint8_t[]){ 1762 | 0b00000000, 1763 | 0b00000000, 1764 | 0b00110000, 1765 | 0b01000000, 1766 | 0b01000000, 1767 | 0b00110000, 1768 | 0b00100000, 1769 | }, 1770 | // egrave 1771 | (const uint8_t[]){ 1772 | 0b01000000, 1773 | 0b00100000, 1774 | 0b01100000, 1775 | 0b10110000, 1776 | 0b11000000, 1777 | 0b01100000, 1778 | 0b00000000, 1779 | }, 1780 | // eacute 1781 | (const uint8_t[]){ 1782 | 0b00100000, 1783 | 0b01000000, 1784 | 0b01100000, 1785 | 0b10110000, 1786 | 0b11000000, 1787 | 0b01100000, 1788 | 0b00000000, 1789 | }, 1790 | // ecircumflex 1791 | (const uint8_t[]){ 1792 | 0b01000000, 1793 | 0b10100000, 1794 | 0b01100000, 1795 | 0b10110000, 1796 | 0b11000000, 1797 | 0b01100000, 1798 | 0b00000000, 1799 | }, 1800 | // edieresis 1801 | (const uint8_t[]){ 1802 | 0b10100000, 1803 | 0b00000000, 1804 | 0b01100000, 1805 | 0b10110000, 1806 | 0b11000000, 1807 | 0b01100000, 1808 | 0b00000000, 1809 | }, 1810 | // igrave 1811 | (const uint8_t[]){ 1812 | 0b01000000, 1813 | 0b00100000, 1814 | 0b01100000, 1815 | 0b00100000, 1816 | 0b00100000, 1817 | 0b01110000, 1818 | 0b00000000, 1819 | }, 1820 | // iacute 1821 | (const uint8_t[]){ 1822 | 0b00100000, 1823 | 0b01000000, 1824 | 0b01100000, 1825 | 0b00100000, 1826 | 0b00100000, 1827 | 0b01110000, 1828 | 0b00000000, 1829 | }, 1830 | // icircumflex 1831 | (const uint8_t[]){ 1832 | 0b00100000, 1833 | 0b01010000, 1834 | 0b01100000, 1835 | 0b00100000, 1836 | 0b00100000, 1837 | 0b01110000, 1838 | 0b00000000, 1839 | }, 1840 | // idieresis 1841 | (const uint8_t[]){ 1842 | 0b01010000, 1843 | 0b00000000, 1844 | 0b01100000, 1845 | 0b00100000, 1846 | 0b00100000, 1847 | 0b01110000, 1848 | 0b00000000, 1849 | }, 1850 | // eth 1851 | (const uint8_t[]){ 1852 | 0b01000000, 1853 | 0b00110000, 1854 | 0b01100000, 1855 | 0b10010000, 1856 | 0b10010000, 1857 | 0b01100000, 1858 | 0b00000000, 1859 | }, 1860 | // ntilde 1861 | (const uint8_t[]){ 1862 | 0b01010000, 1863 | 0b10100000, 1864 | 0b11100000, 1865 | 0b10010000, 1866 | 0b10010000, 1867 | 0b10010000, 1868 | 0b00000000, 1869 | }, 1870 | // ograve 1871 | (const uint8_t[]){ 1872 | 0b01000000, 1873 | 0b00100000, 1874 | 0b01100000, 1875 | 0b10010000, 1876 | 0b10010000, 1877 | 0b01100000, 1878 | 0b00000000, 1879 | }, 1880 | // oacute 1881 | (const uint8_t[]){ 1882 | 0b00100000, 1883 | 0b01000000, 1884 | 0b01100000, 1885 | 0b10010000, 1886 | 0b10010000, 1887 | 0b01100000, 1888 | 0b00000000, 1889 | }, 1890 | // ocircumflex 1891 | (const uint8_t[]){ 1892 | 0b01100000, 1893 | 0b00000000, 1894 | 0b01100000, 1895 | 0b10010000, 1896 | 0b10010000, 1897 | 0b01100000, 1898 | 0b00000000, 1899 | }, 1900 | // otilde 1901 | (const uint8_t[]){ 1902 | 0b01010000, 1903 | 0b10100000, 1904 | 0b01100000, 1905 | 0b10010000, 1906 | 0b10010000, 1907 | 0b01100000, 1908 | 0b00000000, 1909 | }, 1910 | // odieresis 1911 | (const uint8_t[]){ 1912 | 0b01010000, 1913 | 0b00000000, 1914 | 0b01100000, 1915 | 0b10010000, 1916 | 0b10010000, 1917 | 0b01100000, 1918 | 0b00000000, 1919 | }, 1920 | // divide 1921 | (const uint8_t[]){ 1922 | 0b00000000, 1923 | 0b01100000, 1924 | 0b00000000, 1925 | 0b11110000, 1926 | 0b00000000, 1927 | 0b01100000, 1928 | 0b00000000, 1929 | }, 1930 | // oslash 1931 | (const uint8_t[]){ 1932 | 0b00000000, 1933 | 0b00000000, 1934 | 0b01110000, 1935 | 0b10110000, 1936 | 0b11010000, 1937 | 0b11100000, 1938 | 0b00000000, 1939 | }, 1940 | // ugrave 1941 | (const uint8_t[]){ 1942 | 0b01000000, 1943 | 0b00100000, 1944 | 0b10010000, 1945 | 0b10010000, 1946 | 0b10010000, 1947 | 0b01110000, 1948 | 0b00000000, 1949 | }, 1950 | // uacute 1951 | (const uint8_t[]){ 1952 | 0b00100000, 1953 | 0b01000000, 1954 | 0b10010000, 1955 | 0b10010000, 1956 | 0b10010000, 1957 | 0b01110000, 1958 | 0b00000000, 1959 | }, 1960 | // ucircumflex 1961 | (const uint8_t[]){ 1962 | 0b01100000, 1963 | 0b00000000, 1964 | 0b10010000, 1965 | 0b10010000, 1966 | 0b10010000, 1967 | 0b01110000, 1968 | 0b00000000, 1969 | }, 1970 | // udieresis 1971 | (const uint8_t[]){ 1972 | 0b01010000, 1973 | 0b00000000, 1974 | 0b10010000, 1975 | 0b10010000, 1976 | 0b10010000, 1977 | 0b01110000, 1978 | 0b00000000, 1979 | }, 1980 | // yacute 1981 | (const uint8_t[]){ 1982 | 0b00100000, 1983 | 0b01000000, 1984 | 0b10010000, 1985 | 0b10010000, 1986 | 0b01010000, 1987 | 0b00100000, 1988 | 0b01000000, 1989 | }, 1990 | // thorn 1991 | (const uint8_t[]){ 1992 | 0b00000000, 1993 | 0b10000000, 1994 | 0b11100000, 1995 | 0b10010000, 1996 | 0b10010000, 1997 | 0b11100000, 1998 | 0b10000000, 1999 | }, 2000 | } 2001 | }; 2002 | -------------------------------------------------------------------------------- /src/Keypad_MC17.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | || 3 | || @file Keypad_MC17.cpp 4 | || @version 2.0 5 | || @author G. D. (Joe) Young 6 | || @contact "G. D. (Joe) Young" 7 | || 8 | || @description 9 | || | Keypad_MC17 provides an interface for using matrix keypads that 10 | || | are attached with Microchip MCP23017 I2C port expanders. It 11 | || | supports multiple keypads, user selectable pins, and user 12 | || | defined keymaps. 13 | || | The MCP23017 is somewhat similar to the MCP23016 which is supported 14 | || | by the earlier library Keypad_MC16. The difference most useful for 15 | || | use with Keypad is the provision of internal pullup resistors on the 16 | || | pins used as inputs, eliminating the need to provide 16 external 17 | || | resistors. The 23017 also has more comprehensive support for separate 18 | || | 8-bit ports instead of a single 16-bit port. However, this library 19 | || | assumes configuration as 16-bit port--IOCON.BANK = 0. 20 | || # 21 | || 22 | || @version 2.0 - April 5, 2020 23 | || | MKRZERO, ESP32 compile error from inheriting TwoWire that was OK with 24 | || | original ATMEGA boards; possibly because newer processors can have 25 | || | multiple I2C WireX ports. Consequently, added the ability to specify 26 | || | an alternate Wire as optional parameter in constructor. 27 | || # 28 | || 29 | || @license 30 | || | This library is free software; you can redistribute it and/or 31 | || | modify it under the terms of the GNU Lesser General Public 32 | || | License as published by the Free Software Foundation; version 33 | || | 2.1 of the License or any later version. 34 | || | 35 | || | This library is distributed in the hope that it will be useful, 36 | || | but WITHOUT ANY WARRANTY; without even the implied warranty of 37 | || | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 38 | || | Lesser General Public License for more details. 39 | || | 40 | || | You should have received a copy of the GNU Lesser General Public 41 | || | License along with this library; if not, see 42 | || | 43 | || # 44 | || 45 | */ 46 | 47 | #include "../include/Keypad_MC17.h" 48 | 49 | #define GPIOA 0x12 //MCP23017 GPIO reg 50 | #define GPIOB 0x13 //MCP23017 GPIO reg 51 | #define IODIRA 0x00 //MCP23017 I/O direction register 52 | #define IODIRB 0x01 //MCP23017 I/O direction register 53 | #define IOCON 0x0a //MCP23017 I/O configuration register 54 | #define GPPUA 0x0c //MCP23017 pullup resistors control 55 | 56 | /////// Extended Keypad library functions. //////////////////////////// 57 | 58 | 59 | // Let the user define a keymap - assume the same row/column count as defined in constructor 60 | void Keypad_MC17::begin(char *userKeymap) { 61 | Keypad::begin(userKeymap); 62 | _begin( ); 63 | pinState = pinState_set( ); 64 | } 65 | 66 | // Initialize MC17 67 | void Keypad_MC17::begin(void) { 68 | _begin( ); 69 | pinState = pinState_set( ); 70 | } 71 | 72 | word iodirec = 0xffff; //direction of each bit - reset state = all inputs. 73 | byte iocon = 0x10; // reset state for bank, disable slew control 74 | 75 | // Initialize MCP23017 76 | // MCP23017 byte registers act in word pairs 77 | 78 | void Keypad_MC17::_begin( void ) { 79 | iodir_state = iodirec; 80 | _wire->beginTransmission( (int)i2caddr ); 81 | _wire->write( IOCON ); // same as when reset 82 | _wire->write( iocon ); 83 | _wire->endTransmission( ); 84 | _wire->beginTransmission( (int)i2caddr ); 85 | _wire->write( GPPUA ); // enable pullups on all inputs 86 | _wire->write( 0xff ); 87 | _wire->write( 0xff ); 88 | _wire->endTransmission( ); 89 | _wire->beginTransmission( (int)i2caddr ); 90 | _wire->write( IODIRA ); // setup port direction - all inputs to start 91 | _wire->write( lowByte( iodirec ) ); 92 | _wire->write( highByte( iodirec ) ); 93 | _wire->endTransmission( ); 94 | _wire->beginTransmission( (int)i2caddr ); 95 | _wire->write( GPIOA ); //point register pointer to gpio reg 96 | _wire->write( lowByte(iodirec) ); // make o/p latch agree with pulled-up pins 97 | _wire->write( highByte(iodirec) ); 98 | _wire->endTransmission( ); 99 | } // _begin( ) 100 | 101 | void Keypad_MC17::end( void ) { 102 | _wire->beginTransmission( (int)i2caddr ); 103 | _wire->write( IOCON ); // same as when reset 104 | _wire->write( iocon ); 105 | _wire->endTransmission( ); 106 | _wire->beginTransmission( (int)i2caddr ); 107 | _wire->write( GPPUA ); // disable pullups on all inputs 108 | _wire->write( 0x00 ); 109 | _wire->write( 0x00 ); 110 | _wire->endTransmission( ); 111 | _wire->beginTransmission( (int)i2caddr ); 112 | _wire->write( IODIRA ); // setup port direction - all inputs to start 113 | _wire->write( lowByte( 0xffff) ); 114 | _wire->write( highByte( 0xffff ) ); 115 | _wire->endTransmission( ); 116 | _wire->beginTransmission( (int)i2caddr ); 117 | _wire->write( GPIOA ); //point register pointer to gpio reg 118 | _wire->write( lowByte(0xffff) ); // make o/p latch agree with pulled-up pins 119 | _wire->write( highByte(0xffff) ); 120 | _wire->endTransmission( ); 121 | } 122 | 123 | // individual pin setup - modify pin bit in IODIR reg. 124 | void Keypad_MC17::pin_mode(byte pinNum, byte mode) { 125 | word mask = 0b0000000000000001 << pinNum; 126 | if( mode == OUTPUT ) { 127 | iodir_state &= ~mask; 128 | } else { 129 | iodir_state |= mask; 130 | } // if mode 131 | _wire->beginTransmission((int)i2caddr); 132 | _wire->write( IODIRA ); 133 | _wire->write( lowByte( iodir_state ) ); 134 | _wire->write( highByte( iodir_state ) ); 135 | _wire->endTransmission(); 136 | } // pin_mode( ) 137 | 138 | void Keypad_MC17::pin_write(byte pinNum, boolean level) { 139 | word mask = 1<beginTransmission((int)i2caddr); 151 | _wire->write( GPIOA ); 152 | _wire->endTransmission( ); 153 | word mask = 0x1<requestFrom((int)i2caddr, 2); 155 | word pinVal = 0; 156 | pinVal = _wire->read( ); 157 | pinVal |= ( _wire->read( )<<8 ); 158 | pinVal &= mask; 159 | if( pinVal == mask ) { 160 | return 1; 161 | } else { 162 | return 0; 163 | } 164 | } 165 | 166 | void Keypad_MC17::port_write( word i2cportval ) { 167 | // MCP23017 requires a register address on each write 168 | _wire->beginTransmission((int)i2caddr); 169 | _wire->write( GPIOA ); 170 | _wire->write( lowByte( i2cportval ) ); 171 | _wire->write( highByte( i2cportval ) ); 172 | _wire->endTransmission(); 173 | pinState = i2cportval; 174 | } // port_write( ) 175 | 176 | word Keypad_MC17::pinState_set( ) { 177 | _wire->beginTransmission((int)i2caddr); 178 | _wire->write( GPIOA ); 179 | _wire->endTransmission( ); 180 | _wire->requestFrom( (int)i2caddr, 2 ); 181 | pinState = 0; 182 | pinState = _wire->read( ); 183 | pinState |= (_wire->read( )<<8); 184 | return pinState; 185 | } // set_pinState( ) 186 | 187 | // access functions for IODIR state copy 188 | word Keypad_MC17::iodir_read( ) { 189 | return iodir_state; // local copy is always same as chip's register 190 | } // iodir_read( ) 191 | 192 | void Keypad_MC17::iodir_write( word iodir ) { 193 | iodir_state = iodir; 194 | _wire->beginTransmission((int)i2caddr); // read current IODIR reg 195 | _wire->write( IODIRA ); 196 | _wire->write( lowByte( iodir_state ) ); 197 | _wire->write( highByte( iodir_state ) ); 198 | _wire->endTransmission(); 199 | } // iodir_write( ) 200 | 201 | 202 | /* 203 | || @changelog 204 | || | 205 | || | 2.0 2020-04-05 - Joe Young : MKRZERO compile error, Wire spec'd in Constructor 206 | || | 1.0 2014-05-18 - Joe Young : Derived from Keypad_MC16 207 | || # 208 | */ -------------------------------------------------------------------------------- /src/Tetris.cpp.off: -------------------------------------------------------------------------------- 1 | #include "../include/Tetris.h" 2 | //used: 3 | //http://colinfahey.com/tetris/tetris.html 4 | //https://github.com/AJRussell/Tiny-Tetris 5 | //flappy bird game from Ferox myevic 6 | 7 | void ttGame(); 8 | 9 | const uint8_t Blocks[7][2] ={ 10 | { 0b01100000, 0b00000110}, //O 11 | { 0b11110000, 0b00000000}, //I 12 | { 0b11000000, 0b00000110}, //S 13 | { 0b01100000, 0b00001100}, //Z 14 | { 0b11100000, 0b00000010}, //L 15 | { 0b11100000, 0b00001000}, //J 16 | { 0b11100000, 0b00000100} //T 17 | 18 | }; 19 | 20 | //extern 21 | //const uint8_t Blocks[7][2]; 22 | 23 | typedef struct { 24 | uint8_t curBlock[4][4]; //r c 25 | int Row; 26 | int Col; 27 | uint8_t nextBlock[4][4]; 28 | } 29 | PieceSpace; 30 | PieceSpace currentPiece = {0}; 31 | PieceSpace oldPiece = {0}; 32 | 33 | int tetrisScreen[14][24]; 34 | int GarbageScreen[14][24]; 35 | 36 | int ttTetrisLine = 14; 37 | int ttAnimStep = 0; 38 | uint16_t ttScore; 39 | int levellineCount = 0; 40 | uint8_t ttTimeoutMask = 0; 41 | uint8_t ttCurrentTimeout = 0; 42 | uint8_t ttUsedTimeouts = 0; 43 | int gameOver; 44 | int countdown; 45 | int level; 46 | int CurPieceNumber; 47 | int NextPieceNumber; 48 | int nSZ = 3; //for rotate 49 | 50 | int ttKeyDown = 0; 51 | int ttFireDown = 0; 52 | int ttLongFireDown = 0; 53 | uint16_t ttKeyTick = 0; 54 | int pause = 0; 55 | int bto; 56 | int FastMove = 0; //for score 57 | int noShift = 1; 58 | int noRotate = 1; 59 | 60 | //------------------------------------------------------------------------- 61 | 62 | #define TT_NUM_TIMERS 3 63 | 64 | typedef void (TT_TIMEOUT_FUNC(void)); 65 | 66 | typedef struct ttTimeout_s { 67 | uint8_t delay; 68 | TT_TIMEOUT_FUNC *function; 69 | } 70 | ttTimeout_t; 71 | ttTimeout_t ttTimeoutsTable[TT_NUM_TIMERS]; 72 | 73 | void ttInitTimeouts() { 74 | ttCurrentTimeout = 0; 75 | ttUsedTimeouts = 0; 76 | 77 | for (int i = 0; i < TT_NUM_TIMERS; ++i) { 78 | ttTimeoutsTable[i].delay = 0; 79 | ttTimeoutsTable[i].function = 0; 80 | } 81 | } 82 | 83 | void ttTickTimeouts() { 84 | for (int i = 0; i < TT_NUM_TIMERS; ++i) { 85 | if (ttTimeoutsTable[i].delay) { 86 | --ttTimeoutsTable[i].delay; 87 | } 88 | } 89 | } 90 | 91 | void ttDeleteTimeout(int to) { 92 | ttUsedTimeouts &= ~(1 << to); 93 | ttTimeoutsTable[to].delay = 0; 94 | } 95 | 96 | void ttSetTimeoutDelay(int v) { 97 | ttTimeoutsTable[ttCurrentTimeout].delay = v; 98 | } 99 | 100 | void ttCallTimeouts() { 101 | ttTimeoutMask = 1; 102 | 103 | for (ttCurrentTimeout = 0; ttCurrentTimeout < TT_NUM_TIMERS; ++ttCurrentTimeout) { 104 | if (ttUsedTimeouts & ttTimeoutMask) { 105 | if (!ttTimeoutsTable[ttCurrentTimeout].delay) { 106 | ttTimeoutsTable[ttCurrentTimeout].function(); 107 | } 108 | } 109 | ttTimeoutMask <<= 1; 110 | } 111 | } 112 | 113 | int ttCreateTimeout(TT_TIMEOUT_FUNC f) { 114 | uint8_t mask = 1; 115 | 116 | for (int i = 0; i < TT_NUM_TIMERS; ++i) { 117 | if (!(mask & ttUsedTimeouts)) { 118 | ttUsedTimeouts |= mask; 119 | ttTimeoutsTable[i].function = f; 120 | return i; 121 | } 122 | mask <<= 1; 123 | } 124 | return -1; 125 | } 126 | 127 | //void ttCLSBuf() { 128 | // MemClear2(0, ScreenBuffer, SCREEN_BUFFER_SIZE); 129 | //} 130 | 131 | void LoadPiece(int BlockFlag, uint8_t pieceNumber, int col, int row) { 132 | 133 | int r = 0, c = 0; 134 | // uint8_t pieceRow = 0; 135 | // uint8_t pieceColoum = 0; 136 | 137 | for (int i = 0; i < 2; i++) { 138 | 139 | //iterate through bit mask 140 | for (uint8_t mask = 1; mask; mask <<= 1) { 141 | 142 | if (BlockFlag == 0) { //current 143 | 144 | if (mask & Blocks[pieceNumber][i]) { 145 | //0b 0110 0000, 0b 0000 1100 Z 146 | // c 3210 3210 147 | // r 1 0 3 2 148 | // 0123 149 | // 0 0000 150 | // 1 0110 151 | // 2 0011 152 | // 3 0000 153 | currentPiece.curBlock[r][c] = 1; 154 | 155 | } else { 156 | currentPiece.curBlock[r][c] = 0; 157 | 158 | } 159 | } else { //next 160 | 161 | if (mask & Blocks[pieceNumber][i]) { 162 | 163 | currentPiece.nextBlock[r][c] = 1; 164 | 165 | } else { 166 | currentPiece.nextBlock[r][c] = 0; 167 | 168 | } 169 | } 170 | 171 | c++; //c 172 | if (c >= 4) { 173 | c = 0; 174 | r++; //r 175 | } 176 | } 177 | } 178 | 179 | if (BlockFlag == 0) { //current 180 | currentPiece.Row = row; 181 | currentPiece.Col = col; 182 | CurPieceNumber = pieceNumber; 183 | 184 | //if (loadScreen == 1) { 185 | oldPiece = currentPiece; 186 | 187 | /* 188 | for (int r = row; r < row - 4; r--) { 189 | for (int c = col; c < col + 4; c++) { 190 | if (currentPiece.curBlock[pieceRow][pieceColoum]) { 191 | tetrisScreen[c][r] = 2; 192 | 193 | // DrawValue(10, 50, c, 0, 1, 3); 194 | // DrawValue(34, 50, r, 0, 1, 3); 195 | } 196 | pieceColoum++; 197 | } 198 | pieceColoum = 0; 199 | pieceRow++; 200 | } 201 | */ 202 | //} 203 | } else { 204 | NextPieceNumber = pieceNumber; 205 | } 206 | } 207 | 208 | void fillTetrisArray() { 209 | //+2 for border 210 | // x 0 1 (2 3 4 5 6 7 8 9 A B) C D 211 | // 212 | for (int r = 0; r < 24; r++) { 213 | for (int c = 0; c < 14; c++) { 214 | tetrisScreen[c][r] = 1; 215 | } 216 | } 217 | 218 | for (int r = 2; r < 22; r++) { 219 | for (int c = 2; c < 12; c++) { 220 | tetrisScreen[c][r] = 0; 221 | } 222 | } 223 | } 224 | 225 | /* 226 | void fillTetrisScreen(uint8_t value) { 227 | for (int r = 2; r < 22; r++) { 228 | for (int c = 2; c < 12; c++) { 229 | tetrisScreen[c][r] = value; 230 | } 231 | } 232 | } 233 | */ 234 | 235 | int oledX(int x) { 236 | int ox; 237 | ox = (x - 2) * 6 + 2; //start x = 2 238 | return ox; 239 | } 240 | 241 | int oledY(int y) { 242 | int oy; 243 | oy = 122 - (y - 2) * 6; //121 244 | return oy; 245 | } 246 | 247 | void DrawPiece(int X, int Y, int draw) { 248 | // 0000 249 | // 01*0 250 | // 0011 251 | // 0000 252 | 253 | X = oledX(X); 254 | Y = oledY(Y); 255 | 256 | for (int r = 0; r < 4; r++) { 257 | for (int c = 0; c < 4; c++) { 258 | 259 | int x1 = c * 6 + X; 260 | int y1 = r * 6 + Y; 261 | int x2 = x1 + 4; 262 | int y2 = y1 + 4; 263 | 264 | if (!draw) { 265 | if (oldPiece.curBlock[r][c]) { 266 | //DrawFillRect(x1, y1, x2, y2, draw); 267 | lcd.rect(x1, y1, x2, y2, draw); 268 | } 269 | } else if (currentPiece.curBlock[r][c]) { 270 | //DrawFillRect(x1, y1, x2, y2, draw); 271 | lcd.rect(x1, y1, x2, y2, draw); 272 | } 273 | } 274 | } 275 | //DisplayRefresh(); 276 | lcd.Writeframebuffer(); 277 | } 278 | 279 | void DrawNext() //(int X, int Y) 280 | { 281 | //X16 Y-4 282 | for (int r = 0; r < 3; r++) { 283 | for (int c = 0; c < 4; c++) { 284 | int x1 = c * 4 + 15; //+ X; 285 | int y1 = r * 4 - 4; //+ Y; 286 | int x2 = x1 + 2; 287 | int y2 = y1 + 2; 288 | //DrawFillRect(x1, y1, x2, y2, currentPiece.nextBlock[r][c]); 289 | lcd.rect(x1, y1, x2, y2, currentPiece.nextBlock[r][c]); 290 | } 291 | } 292 | //DisplayRefresh(); 293 | lcd.Writeframebuffer(); 294 | } 295 | 296 | void DrawDot(int X, int Y, uint8_t dot) { 297 | X = oledX(X); 298 | Y = oledY(Y); 299 | //DrawFillRect(X, Y, X + 4, Y + 4, dot); 300 | lcd.rect(X, Y, X + 4, Y + 4, dot); 301 | } 302 | 303 | 304 | void DrawHole(int X, int Y) { 305 | X = oledX(X); 306 | Y = oledY(Y); 307 | //DrawFillRect(X + 1, Y + 1, X + 3, Y + 3, 0); 308 | lcd.rect(X + 1, Y + 1, X + 3, Y + 3, 0); 309 | } 310 | 311 | 312 | void DrawBoard() { 313 | //21 314 | // . 0..3 315 | // . .*** 316 | // 4 ...* 317 | // 3 3... 318 | // 2 3 4 ... 11 319 | 320 | if ( dfStatus2.garbage ) gameOver = 2; //check garbage empty 321 | 322 | for (int r = 2; r < 22; r++) { 323 | for (int c = 2; c < 12; c++) { 324 | 325 | if (tetrisScreen[c][r] == 3) tetrisScreen[c][r] = 0; 326 | 327 | if (GarbageScreen[c][r] == 3) GarbageScreen[c][r] = 0; 328 | 329 | if (tetrisScreen[c][r] == 1) { 330 | 331 | DrawDot(c, r, 1); 332 | 333 | if (GarbageScreen[c][r]) { 334 | DrawHole(c, r); 335 | gameOver = 0; //play continue 336 | } 337 | 338 | } else { 339 | DrawDot(c, r, 0); 340 | } 341 | } 342 | } 343 | } 344 | 345 | void fillTetrisScreenRnd() { 346 | 347 | int allzero; 348 | int allfull; 349 | 350 | //tetrisScreen[2][2] = 1; 351 | //tetrisScreen[7][3] = 1; 352 | //tetrisScreen[11][4] = 1; 353 | 354 | //GarbageScreen[2][2]=1; 355 | //GarbageScreen[7][3]=1; 356 | //GarbageScreen[11][4]=1; 357 | 358 | for (int r = 2; r < 6; r++) { 359 | allzero = 1; 360 | allfull = 1; 361 | while(allzero || allfull) { 362 | for (int c = 2; c < 12; c++) { 363 | tetrisScreen[c][r] = (((Random() & 100) - 50) > 50 ) ? 1 : 0 ; 364 | GarbageScreen[c][r] = tetrisScreen[c][r]; 365 | 366 | if (tetrisScreen[c][r]) { 367 | allzero = 0; 368 | } 369 | if (!tetrisScreen[c][r]) { 370 | allfull = 0; 371 | } 372 | } 373 | } 374 | } 375 | DrawBoard(); 376 | } 377 | 378 | void DrawTTCup() { 379 | //DrawHLine( const int x1, const int y, const int x2, const int color ) 380 | DrawHLine(0, 127, 62, 1); 381 | //DrawVLine( const int x, const int y1, const int y2, const int color ) 382 | DrawVLine(0, 8, 127, 1); 383 | DrawVLine(62, 8, 127, 1); 384 | } 385 | 386 | int CheckCollision() { 387 | 388 | int pieceRow = 0; 389 | int pieceCol = 0; 390 | int Col = currentPiece.Col; 391 | int Row = currentPiece.Row; 392 | 393 | for (int r = Row; r > Row - 4; r--) { 394 | for (int c = Col; c < Col + 4; c++) { 395 | 396 | if (currentPiece.curBlock[pieceRow][pieceCol]) { 397 | if (tetrisScreen[c][r] == 1) { 398 | return 1; 399 | } 400 | } 401 | pieceCol++; 402 | } 403 | pieceCol = 0; 404 | pieceRow++; 405 | } 406 | return 0; 407 | } 408 | 409 | void RotatePiece() { 410 | 411 | int c; 412 | int r; 413 | int i; 414 | uint8_t Fig[4][4] = {0}; 415 | 416 | if (CurPieceNumber == 0) { 417 | return; // O 418 | } 419 | 420 | oldPiece = currentPiece; 421 | 422 | if (CurPieceNumber == 1) { 423 | // I 424 | for (r = 0; r < 4; ++r) { 425 | for (c = 0; c < 4; ++c) { 426 | Fig[r][c] = currentPiece.curBlock[3 - c][3 - r]; 427 | } 428 | } 429 | MemCpy(currentPiece.curBlock, Fig, 16); 430 | 431 | } else if (CurPieceNumber == 2 || CurPieceNumber == 3) { 432 | // S Z 433 | nSZ = nSZ == 1 ? 3 : 1; 434 | 435 | for (i = 0; i < nSZ; ++i) { 436 | 437 | for (r = 0; r < 4; ++r) { 438 | for (c = 1; c < 4; ++c) { 439 | Fig[r][c] = currentPiece.curBlock[c - 1][3 - r]; 440 | } 441 | } 442 | MemCpy(currentPiece.curBlock, Fig, 16); 443 | } 444 | } else { // L J T 445 | for (r = 0; r < 4; ++r) { 446 | for (c = 1; c < 4; ++c) { 447 | Fig[r][c] = currentPiece.curBlock[c - 1][3 - r]; 448 | } 449 | } 450 | MemCpy(currentPiece.curBlock, Fig, 16); 451 | } 452 | 453 | if (CheckCollision()) { 454 | currentPiece = oldPiece; 455 | 456 | } else { 457 | DrawPiece(oldPiece.Col, oldPiece.Row, 0); 458 | DrawPiece(currentPiece.Col, currentPiece.Row, 1); 459 | //DisplayRefresh(); 460 | } 461 | } 462 | 463 | void movePieceLeft() { 464 | 465 | oldPiece = currentPiece; 466 | currentPiece.Col = currentPiece.Col - 1; 467 | 468 | if (CheckCollision()) { 469 | currentPiece = oldPiece; 470 | } else { 471 | DrawPiece(oldPiece.Col, oldPiece.Row, 0); 472 | DrawPiece(currentPiece.Col, currentPiece.Row, 1); 473 | // DisplayRefresh(); 474 | } 475 | } 476 | 477 | void movePieceRight() { 478 | oldPiece = currentPiece; 479 | currentPiece.Col = currentPiece.Col + 1; 480 | 481 | if (CheckCollision()) { 482 | currentPiece = oldPiece; 483 | } else { 484 | DrawPiece(oldPiece.Col, oldPiece.Row, 0); 485 | DrawPiece(currentPiece.Col, currentPiece.Row, 1); 486 | // DisplayRefresh(); 487 | } 488 | } 489 | 490 | void setScore(uint16_t score) //, int show) 491 | { 492 | //DrawValue(x, y, value, dot_pos, font, num_digits); 493 | //if (show) { 494 | //DrawValue(33, 0, score, 0, 0x0B, 5); 495 | //lcd.text(score, 33, 0, true); 496 | //} else { 497 | // DrawFillRect(33, 0, 63, 7, 0); 498 | //} 499 | } 500 | 501 | void setLevel(uint16_t lvl) //, int show) 502 | { 503 | //DrawValue(x, y, value, dot_pos, font, num_digits); 504 | //if (show) { 505 | //DrawValue(1, 0, lvl, 0, 0x0B, 2); 506 | //} else { 507 | // DrawFillRect(1, 0, 12, 7, 0); 508 | //} 509 | } 510 | 511 | void CompletedLines() { 512 | 513 | int fullLine; 514 | int noLine; 515 | int linesProcessed = 0; 516 | int clearedLines; 517 | int topRow; 518 | int bottomRow; 519 | uint16_t AmountScored = 0; 520 | 521 | if (currentPiece.Row > 5) bottomRow = currentPiece.Row - 4; 522 | else bottomRow = 1; 523 | 524 | if (currentPiece.Row == 22) topRow = 21; 525 | else topRow = currentPiece.Row; 526 | 527 | for (int rowCheck = topRow; rowCheck > bottomRow; rowCheck--) { 528 | 529 | fullLine = 1; 530 | for (int colCheck = 2; colCheck < 12; colCheck++) { 531 | if (tetrisScreen[colCheck][rowCheck] == 0) { 532 | fullLine = 0; 533 | break; 534 | } 535 | } 536 | 537 | if (fullLine) { 538 | //make line values 3's and render 539 | for (int c = 2; c < 12; c++) { 540 | tetrisScreen[c][rowCheck] = 3; //will be 0 in DrawBoard() 541 | //DrawHole(c, rowCheck); //animation 542 | //DisplayRefresh(); 543 | } 544 | // bottomRow = rowCheck - 1; ? 545 | linesProcessed++; 546 | // animation 547 | } 548 | DrawBoard(); 549 | } 550 | 551 | if (linesProcessed) { 552 | 553 | clearedLines = linesProcessed; 554 | 555 | while (clearedLines) { 556 | for (int currentRow = 2; currentRow < 22; currentRow++) { 557 | noLine = 1; 558 | for (int c = 2; c < 12; c++) { 559 | if (tetrisScreen[c][currentRow]) noLine = 0; //line not empty 560 | } 561 | if (noLine) { 562 | //move all lines down 563 | for (int r = currentRow + 1; r < 22; r++) { 564 | for (int c = 2; c < 12; c++) { 565 | 566 | if (tetrisScreen[c][r]) tetrisScreen[c][r - 1] = 1; //2; 567 | else tetrisScreen[c][r - 1] = 3; 568 | 569 | if (GarbageScreen[c][r]) GarbageScreen[c][r - 1] = 1; 570 | else GarbageScreen[c][r - 1] = 3; 571 | 572 | } 573 | } 574 | } 575 | } 576 | 577 | /* 578 | //make the 2's 1's 579 | for (int r = 2; r < 22; r++) { 580 | for (int c = 2; c < 12; c++) { 581 | if (tetrisScreen[c][r] == 2) tetrisScreen[c][r] = 1; 582 | } 583 | } 584 | */ 585 | 586 | clearedLines--; 587 | DrawBoard(); 588 | } 589 | 590 | //process score 591 | switch (linesProcessed) { 592 | case 1: 593 | AmountScored = 10; 594 | break; 595 | case 2: 596 | AmountScored = 30; 597 | break; 598 | case 3: 599 | AmountScored = 70; 600 | break; 601 | case 4: 602 | AmountScored = 150; 603 | //do 4 line affect 604 | break; 605 | } 606 | 607 | fullLine = 1; 608 | for (int colCheck = 2; colCheck < 12; colCheck++) { 609 | if (tetrisScreen[colCheck][2]) { 610 | fullLine = 0; 611 | break; 612 | } 613 | } 614 | if (fullLine) AmountScored += 150; //empty board 615 | 616 | FastMove /= 10; 617 | AmountScored += FastMove; // fast drop count + noTouch + noRotate 618 | FastMove = 0; 619 | AmountScored *= level; 620 | 621 | if ( ( ttScore + AmountScored ) >> 8 < 255 ) 622 | ttScore += AmountScored; 623 | else 624 | gameOver = 2; 625 | 626 | setScore(ttScore); 627 | 628 | //update level line count & level 629 | levellineCount += linesProcessed; 630 | if (levellineCount > 10) { 631 | level++; 632 | levellineCount = 0; 633 | //do level up affect 634 | } 635 | if (dfTTSpeed != 2) 636 | { 637 | if (level > 10) gameOver = 2; 638 | } 639 | else 640 | { 641 | if (level > 99) gameOver = 2; 642 | } 643 | setLevel(level); 644 | 645 | } 646 | 647 | //make the 2's 1's ? 648 | /* 649 | for (int r = bottomRow; r <= topRow; r++) { 650 | for (int c = 2; c < 12; c++) { 651 | if (tetrisScreen[c][r]) { 652 | tetrisScreen[c][r] = 1; 653 | } 654 | } 655 | } 656 | */ 657 | } 658 | 659 | void DrawLandedPiece() { 660 | // Landed pieces are 1 661 | int pieceRow = 0; 662 | int pieceColoum = 0; 663 | 664 | int Col = currentPiece.Col; 665 | int Row = currentPiece.Row; 666 | 667 | for (int r = Row; r > Row - 4; r--) { 668 | for (int c = Col; c < Col + 4; c++) { 669 | 670 | if (currentPiece.curBlock[pieceRow][pieceColoum]) tetrisScreen[c][r] = 1; 671 | pieceColoum++; 672 | } 673 | pieceColoum = 0; 674 | pieceRow++; 675 | } 676 | 677 | if (CurPieceNumber) FastMove += noRotate * 10; //score bonus 678 | FastMove += noShift * 20; 679 | noRotate = 1; 680 | noShift = 1; 681 | 682 | CompletedLines(); 683 | } 684 | 685 | void movePieceDown() { 686 | int pieceLanded = 0; 687 | 688 | oldPiece = currentPiece; 689 | currentPiece.Row = currentPiece.Row - 1; 690 | 691 | if (CheckCollision()) { 692 | currentPiece = oldPiece; 693 | 694 | DrawLandedPiece(); 695 | pieceLanded = 1; 696 | 697 | } else { 698 | DrawPiece(oldPiece.Col, oldPiece.Row, 0); 699 | DrawPiece(currentPiece.Col, currentPiece.Row, 1); 700 | //DisplayRefresh(); 701 | } 702 | 703 | if (pieceLanded) { 704 | MemCpy(currentPiece.curBlock, currentPiece.nextBlock, 16); 705 | currentPiece.Row = 22; 706 | currentPiece.Col = 5; 707 | CurPieceNumber = NextPieceNumber; 708 | DrawPiece(currentPiece.Col, currentPiece.Row, 1); 709 | //DisplayRefresh(); 710 | 711 | if (CheckCollision()) { 712 | gameOver = 1; 713 | } else { 714 | //next piece 715 | LoadPiece(1, (uint8_t) Random() % 7, 0, 0); 716 | DrawNext(); //(16, -4); 717 | // DisplayRefresh(); 718 | } 719 | } 720 | } 721 | 722 | void CheckButtons() { 723 | 724 | 725 | if (gameOver) { 726 | ttDeleteTimeout(ttCurrentTimeout); 727 | return; 728 | } 729 | 730 | if (!ttKeyDown) { 731 | 732 | if (!PE0 && (!PD2 || !PD3)) { 733 | ttKeyDown = 0; 734 | return; 735 | } 736 | 737 | if (!PD2 && !PD3) { 738 | pause ^= 1; //pause == 0 ? 1 : 0; 739 | ttKeyDown = 0; 740 | ttSetTimeoutDelay(100); 741 | return; 742 | } 743 | 744 | if (pause) return; 745 | 746 | if (!PD2) { 747 | if ( !ScrFlip && dfStatus.flipped ) movePieceLeft(); 748 | else movePieceRight(); 749 | noShift = 0; 750 | ttKeyDown = 1; 751 | ttFireDown = 0; 752 | ttSetTimeoutDelay(bto); 753 | return; 754 | 755 | } else if (!PD3) { 756 | if ( !ScrFlip && dfStatus.flipped ) movePieceRight(); 757 | else movePieceLeft(); 758 | noShift = 0; 759 | ttKeyDown = 1; 760 | ttFireDown = 0; 761 | ttSetTimeoutDelay(bto); 762 | return; 763 | 764 | } else if (!PE0) { 765 | if ((!ttFireDown) && (!ttLongFireDown)) { 766 | ttFireDown = 1; 767 | ttSetTimeoutDelay(bto); 768 | } 769 | if (ttKeyTick > 5) { 770 | ttLongFireDown = 1; 771 | //long press 772 | movePieceDown(); 773 | FastMove += 1; 774 | ttSetTimeoutDelay(bto); 775 | } 776 | ++ttKeyTick; 777 | ttKeyDown = 0; 778 | ttSetTimeoutDelay(bto); 779 | return; 780 | } 781 | } 782 | 783 | if (ttFireDown) { 784 | //fire up 785 | if (ttLongFireDown) { 786 | ttLongFireDown = 0; 787 | } else { 788 | // click 789 | RotatePiece(); 790 | noRotate = 0; 791 | ttSetTimeoutDelay(bto); 792 | } 793 | } 794 | 795 | if (PD2 && PD3 && PE0) { 796 | ttKeyDown = 0; 797 | ttFireDown = 0; 798 | ttKeyTick = 0; 799 | ttLongFireDown = 0; 800 | ttSetTimeoutDelay(bto); //for no l-r shift after k_up 801 | } 802 | } 803 | 804 | void ttStartScreen() { 805 | 806 | //const uint8_t strVaping[] = {0x7D, 0x68, 0x77, 0x70, 0x75, 0x6E, 0x00}; 807 | //const uint8_t strTetris[] = {0xAF, 0xA0, 0xAF, 0xAD, 0xA4, 0xAE, 0x00}; 808 | //const uint8_t strBestScore[] = {0x69, 0x6C, 0x7A, 0x7B, 0x00}; 809 | //const uint8_t strLastScore[] = {0x8D, 0x82, 0x94, 0x95, 0x00}; 810 | 811 | ttSetTimeoutDelay(10); 812 | if (!PE0 && (PD2 && PD3)) { 813 | 814 | gameOver = 0; 815 | ttScore = 0; 816 | level = 1; 817 | pause = 0; 818 | FastMove = 0; 819 | noRotate = 1; 820 | noShift = 1; 821 | SetRandSeed(TMR1Counter); 822 | MemClear2(0, ScreenBuffer, SCREEN_BUFFER_SIZE); //ttCLSBuf(); 823 | 824 | fillTetrisArray(); //+2 border 825 | //fillTetrisScreen(0); //2-11 x 2-21 826 | if ( dfStatus2.garbage ) fillTetrisScreenRnd(); 827 | 828 | DrawTTCup(); 829 | setLevel(level); 830 | setScore(0); 831 | 832 | //rnd 0-6 833 | nSZ = 3; //for rotate 834 | LoadPiece(0, (uint8_t) (Random() % 7), 5, 22); 835 | DrawPiece(currentPiece.Col, currentPiece.Row, 1); 836 | //CheckCollision(); 837 | LoadPiece(1, (uint8_t) Random() % 7, 0, 0); //get next piece 838 | DrawNext(); //(16, -4); 839 | //DisplayRefresh(); 840 | 841 | //KeyUpTimer = 0; 842 | //ttKeyTick = 0; 843 | //ttFireDown = 0; 844 | //ttLongFireDown = 0; 845 | ttKeyDown = 1; 846 | 847 | ttDeleteTimeout(ttCurrentTimeout); 848 | 849 | ttSetTimeoutDelay(100); 850 | ttCreateTimeout(ttGame); 851 | ttCreateTimeout(CheckButtons); 852 | 853 | } else { 854 | 855 | DrawFillRect(0, 18, 63, 108, 0); //erase 856 | 857 | if (ttAnimStep) { 858 | if (++ttTetrisLine == 16) 859 | ttAnimStep = 0; 860 | } else { 861 | --ttTetrisLine; 862 | if (ttTetrisLine == 0) 863 | ttAnimStep = 1; 864 | } 865 | 866 | DrawString(String_Vaping, 14, ttTetrisLine + 20); 867 | DrawString(String_Tetris, 14, ttTetrisLine + 30); 868 | 869 | uint8_t strbuf[5]; 870 | convert_string1( strbuf, "Best" ); 871 | DrawString(strbuf, 4, 60); 872 | convert_string1( strbuf, "Last" ); 873 | DrawString(strbuf, 4, 70); 874 | //DrawString(strBestScore, 4, 60); 875 | //DrawString(strLastScore, 4, 70); 876 | DrawValue(29, 60, dfTTBest, 0, 0x0B, 5); 877 | DrawValue(29, 70, ttScore, 0, 0x0B, 5); 878 | 879 | switch ( dfTTSpeed ) 880 | { 881 | case 0: DrawStringCentered(String_Easy, 95); break; 882 | case 1: DrawStringCentered(String_Normal, 95); break; 883 | case 2: DrawStringCentered(String_Survival, 95); break; 884 | } 885 | 886 | if ( gameOver == 2 ) 887 | { 888 | uint8_t strbuf[4]; 889 | convert_string1( strbuf, "WIN" ); 890 | DrawStringCentered(strbuf, 84); 891 | } 892 | 893 | DrawTTCup(); 894 | //DisplayRefresh(); 895 | lcd.Writeframebuffer(); 896 | ttSetTimeoutDelay(10); 897 | //ttCLSBuf(); 898 | } 899 | } 900 | 901 | void ttGame() { 902 | 903 | if (pause) 904 | { 905 | SleepTimer = 3000; 906 | return; 907 | } 908 | 909 | if (gameOver) { 910 | //ttCLSBuf(); 911 | 912 | if (!PE0) return; 913 | 914 | if (dfTTBest < ttScore) { 915 | dfTTBest = ttScore; 916 | ttSetTimeoutDelay(4); 917 | UpdateDFTimer = 50; 918 | } 919 | 920 | //ClearScreenBuffer(); 921 | //DisplayRefresh(); 922 | ttDeleteTimeout(ttCurrentTimeout); 923 | ttCreateTimeout(ttStartScreen + 1); 924 | 925 | } 926 | 927 | if (dfTTSpeed != 2) countdown = 5 * (11 - level); 928 | ttSetTimeoutDelay(countdown); 929 | 930 | movePieceDown(); 931 | } 932 | 933 | void ttStartGame() { 934 | 935 | //UpdateDataFlash(); 936 | //if (dfTTSpeed > 2) dfTTSpeed = 2; 937 | 938 | if (dfTTBest < ttScore) { 939 | dfTTBest = ttScore; 940 | ttSetTimeoutDelay(4); 941 | UpdateDFTimer = 50; //survive 942 | } 943 | 944 | if (dfTTSpeed == 2) { 945 | bto = 5; 946 | countdown = 50; 947 | } else if (dfTTSpeed == 1) { 948 | bto = 5; 949 | } else { 950 | bto = 3; 951 | } 952 | 953 | gFlags.playing_tt = 1; 954 | Screen = 0; 955 | gFlags.user_idle = 1; //0 956 | gameOver = 0; 957 | NoEventTimer = 0; 958 | SleepTimer = 3000; //30 sec for first time 959 | ttInitTimeouts(); 960 | ClearScreenBuffer(); 961 | //DisplayRefresh(); 962 | //gFlags.refresh_display = 1; 963 | 964 | ttSetTimeoutDelay(20); 965 | ttCreateTimeout(ttStartScreen + 1); 966 | } -------------------------------------------------------------------------------- /src/bitmap.h: -------------------------------------------------------------------------------- 1 | const unsigned char BMP[1600] = { 2 | // 'Casio Display, 192x64px 3 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 15 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 16 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 17 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 18 | 0x1f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x18, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 21 | 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x38, 0x18, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x18, 24 | 0x18, 0x03, 0x07, 0x81, 0x9e, 0x06, 0x78, 0x30, 0x7e, 0x06, 0x0e, 0x0c, 0x7c, 0x07, 0xe0, 0x19, 25 | 0xe0, 0x3c, 0x0d, 0xc3, 0xc0, 0x00, 0x60, 0x0c, 0x18, 0x03, 0x0f, 0xe1, 0xff, 0x07, 0xfc, 0x30, 26 | 0xfc, 0x07, 0x0e, 0x18, 0xfe, 0x0f, 0xc0, 0x1b, 0xf0, 0x7f, 0x0f, 0xc7, 0xf0, 0x0e, 0x60, 0x0c, 27 | 0x18, 0x03, 0x18, 0x61, 0xc3, 0x87, 0x0e, 0x31, 0x80, 0x03, 0x0a, 0x18, 0x03, 0x18, 0x00, 0x1c, 28 | 0x38, 0xc3, 0x0e, 0x0c, 0x30, 0x0e, 0x60, 0x0c, 0x18, 0x03, 0x18, 0x31, 0x81, 0x86, 0x06, 0x31, 29 | 0x80, 0x03, 0x0a, 0x18, 0x03, 0x18, 0x00, 0x18, 0x18, 0xc1, 0x8c, 0x0c, 0x18, 0x0e, 0x60, 0x0c, 30 | 0x18, 0x03, 0x30, 0x31, 0x81, 0x86, 0x06, 0x31, 0xc0, 0x03, 0x1b, 0x18, 0x1f, 0x1c, 0x00, 0x18, 31 | 0x19, 0x81, 0x8c, 0x18, 0x18, 0x00, 0x60, 0x0c, 0x18, 0x03, 0x3f, 0xf1, 0x81, 0x86, 0x06, 0x30, 32 | 0xf8, 0x01, 0x9b, 0x30, 0x7f, 0x0f, 0x80, 0x18, 0x19, 0xff, 0x8c, 0x1f, 0xf8, 0x00, 0x60, 0x0c, 33 | 0x18, 0x06, 0x3f, 0xf1, 0x81, 0x86, 0x06, 0x30, 0x3c, 0x01, 0x91, 0x30, 0xc3, 0x03, 0xc0, 0x18, 34 | 0x19, 0xff, 0x8c, 0x1f, 0xf8, 0x00, 0x60, 0x18, 0x18, 0x06, 0x30, 0x01, 0x81, 0x86, 0x06, 0x30, 35 | 0x0e, 0x01, 0xb1, 0xb1, 0x83, 0x00, 0xe0, 0x18, 0x19, 0x80, 0x0c, 0x18, 0x00, 0x00, 0x60, 0x18, 36 | 0x18, 0x0e, 0x30, 0x01, 0x81, 0x86, 0x06, 0x30, 0x06, 0x00, 0xb1, 0xa1, 0x83, 0x00, 0x60, 0x18, 37 | 0x19, 0x80, 0x0c, 0x18, 0x00, 0x00, 0x60, 0x38, 0x18, 0x1c, 0x18, 0x01, 0x81, 0x86, 0x06, 0x30, 38 | 0x06, 0x00, 0xa0, 0xe1, 0x87, 0x00, 0x60, 0x18, 0x18, 0xc0, 0x0c, 0x0c, 0x00, 0x0e, 0x60, 0x70, 39 | 0x1f, 0xf8, 0x0f, 0xe1, 0x81, 0x86, 0x06, 0x31, 0xfc, 0x00, 0xe0, 0xe0, 0xff, 0x1f, 0xc0, 0x18, 40 | 0x18, 0x7f, 0x0c, 0x07, 0xf0, 0x0e, 0x7f, 0xe0, 0x1f, 0xc0, 0x07, 0xe1, 0x81, 0x86, 0x06, 0x31, 41 | 0xf8, 0x00, 0xe0, 0xc0, 0x7b, 0x1f, 0x80, 0x18, 0x18, 0x3f, 0x0c, 0x03, 0xf0, 0x0e, 0x7f, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x03, 0xff, 0x8f, 0xff, 0x8f, 0xff, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 62 | 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x07, 0x01, 0xf8, 0x00, 0xf8, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 65 | 0x01, 0xc0, 0x1f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x07, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0xc0, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 69 | 0x00, 0x03, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x1f, 0xc0, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0xc0, 0x07, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0xf0, 0xe0, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x60, 0x00, 0x01, 0xe0, 0xfe, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x07, 0xc0, 0xfe, 0x00, 0x7f, 76 | 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0xe0, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x07, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xcf, 0x80, 0x00, 0x00, 0x00, 0x1f, 80 | 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 81 | 0x00, 0x0e, 0x07, 0xbf, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 82 | 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf0, 83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, 84 | 0x00, 0x18, 0x07, 0xe1, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 85 | 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 87 | 0x00, 0x1c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 88 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x0e, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 89 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x00, 90 | 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 91 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 92 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 93 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 94 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 95 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 96 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 97 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 98 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 99 | }; 100 | 101 | const unsigned char hacked[1600] = { 102 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 103 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 104 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 105 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 106 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 107 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 108 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 109 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 110 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 111 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 112 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 113 | 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 114 | 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 115 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 116 | 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 117 | 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 118 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 119 | 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 120 | 0x00, 0x00, 0xc0, 0x30, 0x7c, 0x03, 0xf3, 0x0e, 0x0f, 0x01, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 121 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0xfe, 0x07, 0xf3, 0x1c, 122 | 0x1f, 0xc3, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 123 | 0x00, 0x00, 0xc0, 0x30, 0x03, 0x0e, 0x03, 0x38, 0x30, 0xc6, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 124 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf0, 0x03, 0x0c, 0x03, 0x30, 125 | 0x30, 0x6e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 126 | 0x00, 0x00, 0xff, 0xf0, 0x1f, 0x18, 0x03, 0x60, 0x60, 0x6c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 127 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x7f, 0x18, 0x03, 0xe0, 128 | 0x7f, 0xec, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 129 | 0x00, 0x00, 0xc0, 0x30, 0xc3, 0x18, 0x03, 0xf0, 0x7f, 0xec, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 130 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x31, 0x83, 0x18, 0x03, 0x30, 131 | 0x60, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 132 | 0x00, 0x00, 0xc0, 0x31, 0x83, 0x1c, 0x03, 0x18, 0x60, 0x0e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 133 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x31, 0x87, 0x0e, 0x03, 0x1c, 134 | 0x30, 0x06, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 135 | 0x00, 0x00, 0xc0, 0x30, 0xff, 0x07, 0xf3, 0x0e, 0x1f, 0xc7, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 136 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x7b, 0x03, 0xf3, 0x07, 137 | 0x0f, 0xc1, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 138 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 139 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 140 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 142 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 143 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 144 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 145 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 146 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 147 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 148 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 149 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 150 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 151 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 152 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 153 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 154 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 155 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 156 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 157 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 158 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 159 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 160 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 161 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 162 | 0x00, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 163 | 0x00, 0x00, 0x18, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 164 | 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x60, 0x00, 0x00, 0x00, 165 | 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 166 | 0x00, 0x00, 0x18, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 167 | 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 168 | 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 169 | 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xf0, 0x01, 0xbc, 0x78, 0x30, 170 | 0x60, 0x7e, 0x33, 0xc0, 0x03, 0xcc, 0x37, 0x1f, 0x06, 0x78, 0x19, 0xe0, 0x60, 0xfc, 0x3f, 0x00, 171 | 0x00, 0x70, 0x03, 0xf8, 0x01, 0xfe, 0xfc, 0x30, 0x60, 0xfe, 0x37, 0xe0, 0x07, 0xfc, 0x3f, 0x3f, 172 | 0x86, 0xfe, 0x1b, 0xf0, 0x61, 0xfc, 0x7e, 0x00, 0x00, 0x7c, 0x06, 0x0c, 0x01, 0xc7, 0x8e, 0x30, 173 | 0x61, 0xc0, 0x38, 0x70, 0x0c, 0x1c, 0x38, 0x00, 0xc7, 0x06, 0x1c, 0x38, 0x63, 0x80, 0xc0, 0x00, 174 | 0x00, 0x1f, 0x0e, 0x0e, 0x01, 0x83, 0x06, 0x30, 0x61, 0x80, 0x30, 0x30, 0x1c, 0x0c, 0x30, 0x00, 175 | 0xc7, 0x07, 0x18, 0x18, 0x63, 0x00, 0xc0, 0x00, 0x00, 0x07, 0x8c, 0x06, 0x01, 0x83, 0x06, 0x30, 176 | 0x63, 0x00, 0x30, 0x30, 0x18, 0x0c, 0x30, 0x07, 0xc6, 0x03, 0x18, 0x18, 0x66, 0x00, 0xe0, 0x00, 177 | 0x00, 0x01, 0xcc, 0x06, 0x01, 0x83, 0x06, 0x30, 0x63, 0x00, 0x30, 0x30, 0x18, 0x0c, 0x30, 0x1f, 178 | 0xc6, 0x03, 0x18, 0x18, 0x66, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xcc, 0x06, 0x01, 0x83, 0x06, 0x30, 179 | 0x63, 0x00, 0x30, 0x30, 0x18, 0x0c, 0x30, 0x30, 0xc6, 0x03, 0x18, 0x18, 0x66, 0x00, 0x1e, 0x00, 180 | 0x00, 0x00, 0xcc, 0x06, 0x01, 0x83, 0x06, 0x30, 0x63, 0x00, 0x30, 0x30, 0x18, 0x0c, 0x30, 0x60, 181 | 0xc6, 0x03, 0x18, 0x18, 0x66, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, 0x0c, 0x01, 0x83, 0x06, 0x30, 182 | 0x63, 0x80, 0x30, 0x30, 0x1c, 0x1c, 0x30, 0x60, 0xc6, 0x07, 0x18, 0x18, 0x67, 0x00, 0x03, 0x00, 183 | 0x00, 0x81, 0x86, 0x0c, 0x01, 0x83, 0x06, 0x38, 0xe1, 0xc0, 0x30, 0x30, 0x0e, 0x1c, 0x30, 0x61, 184 | 0xc7, 0x06, 0x18, 0x18, 0x63, 0x80, 0x03, 0x00, 0x00, 0xff, 0x83, 0xf8, 0x01, 0x83, 0x06, 0x1f, 185 | 0xe0, 0xfe, 0x30, 0x30, 0x07, 0xec, 0x30, 0x3f, 0xc7, 0xfc, 0x18, 0x18, 0x61, 0xfc, 0xfe, 0x00, 186 | 0x00, 0x7e, 0x01, 0xf0, 0x01, 0x83, 0x06, 0x0e, 0x60, 0x7e, 0x30, 0x30, 0x03, 0x8c, 0x30, 0x1e, 187 | 0xc6, 0xf8, 0x18, 0x18, 0x60, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 188 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 189 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 190 | 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 191 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 192 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, 193 | 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 194 | 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 195 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 196 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 197 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 198 | 199 | }; -------------------------------------------------------------------------------- /src/bitmaps.h: -------------------------------------------------------------------------------- 1 | const unsigned char BMP[1600] = { 2 | // 'Casio Display, 192x64px 3 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 15 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 16 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 17 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 18 | 0x1f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x18, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 21 | 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x38, 0x18, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x18, 24 | 0x18, 0x03, 0x07, 0x81, 0x9e, 0x06, 0x78, 0x30, 0x7e, 0x06, 0x0e, 0x0c, 0x7c, 0x07, 0xe0, 0x19, 25 | 0xe0, 0x3c, 0x0d, 0xc3, 0xc0, 0x00, 0x60, 0x0c, 0x18, 0x03, 0x0f, 0xe1, 0xff, 0x07, 0xfc, 0x30, 26 | 0xfc, 0x07, 0x0e, 0x18, 0xfe, 0x0f, 0xc0, 0x1b, 0xf0, 0x7f, 0x0f, 0xc7, 0xf0, 0x0e, 0x60, 0x0c, 27 | 0x18, 0x03, 0x18, 0x61, 0xc3, 0x87, 0x0e, 0x31, 0x80, 0x03, 0x0a, 0x18, 0x03, 0x18, 0x00, 0x1c, 28 | 0x38, 0xc3, 0x0e, 0x0c, 0x30, 0x0e, 0x60, 0x0c, 0x18, 0x03, 0x18, 0x31, 0x81, 0x86, 0x06, 0x31, 29 | 0x80, 0x03, 0x0a, 0x18, 0x03, 0x18, 0x00, 0x18, 0x18, 0xc1, 0x8c, 0x0c, 0x18, 0x0e, 0x60, 0x0c, 30 | 0x18, 0x03, 0x30, 0x31, 0x81, 0x86, 0x06, 0x31, 0xc0, 0x03, 0x1b, 0x18, 0x1f, 0x1c, 0x00, 0x18, 31 | 0x19, 0x81, 0x8c, 0x18, 0x18, 0x00, 0x60, 0x0c, 0x18, 0x03, 0x3f, 0xf1, 0x81, 0x86, 0x06, 0x30, 32 | 0xf8, 0x01, 0x9b, 0x30, 0x7f, 0x0f, 0x80, 0x18, 0x19, 0xff, 0x8c, 0x1f, 0xf8, 0x00, 0x60, 0x0c, 33 | 0x18, 0x06, 0x3f, 0xf1, 0x81, 0x86, 0x06, 0x30, 0x3c, 0x01, 0x91, 0x30, 0xc3, 0x03, 0xc0, 0x18, 34 | 0x19, 0xff, 0x8c, 0x1f, 0xf8, 0x00, 0x60, 0x18, 0x18, 0x06, 0x30, 0x01, 0x81, 0x86, 0x06, 0x30, 35 | 0x0e, 0x01, 0xb1, 0xb1, 0x83, 0x00, 0xe0, 0x18, 0x19, 0x80, 0x0c, 0x18, 0x00, 0x00, 0x60, 0x18, 36 | 0x18, 0x0e, 0x30, 0x01, 0x81, 0x86, 0x06, 0x30, 0x06, 0x00, 0xb1, 0xa1, 0x83, 0x00, 0x60, 0x18, 37 | 0x19, 0x80, 0x0c, 0x18, 0x00, 0x00, 0x60, 0x38, 0x18, 0x1c, 0x18, 0x01, 0x81, 0x86, 0x06, 0x30, 38 | 0x06, 0x00, 0xa0, 0xe1, 0x87, 0x00, 0x60, 0x18, 0x18, 0xc0, 0x0c, 0x0c, 0x00, 0x0e, 0x60, 0x70, 39 | 0x1f, 0xf8, 0x0f, 0xe1, 0x81, 0x86, 0x06, 0x31, 0xfc, 0x00, 0xe0, 0xe0, 0xff, 0x1f, 0xc0, 0x18, 40 | 0x18, 0x7f, 0x0c, 0x07, 0xf0, 0x0e, 0x7f, 0xe0, 0x1f, 0xc0, 0x07, 0xe1, 0x81, 0x86, 0x06, 0x31, 41 | 0xf8, 0x00, 0xe0, 0xc0, 0x7b, 0x1f, 0x80, 0x18, 0x18, 0x3f, 0x0c, 0x03, 0xf0, 0x0e, 0x7f, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x03, 0xff, 0x8f, 0xff, 0x8f, 0xff, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 62 | 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x07, 0x01, 0xf8, 0x00, 0xf8, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 65 | 0x01, 0xc0, 0x1f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x07, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0xc0, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 69 | 0x00, 0x03, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x1f, 0xc0, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0xc0, 0x07, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0xf0, 0xe0, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x60, 0x00, 0x01, 0xe0, 0xfe, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x07, 0xc0, 0xfe, 0x00, 0x7f, 76 | 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0xe0, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x07, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xcf, 0x80, 0x00, 0x00, 0x00, 0x1f, 80 | 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 81 | 0x00, 0x0e, 0x07, 0xbf, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 82 | 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf0, 83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, 84 | 0x00, 0x18, 0x07, 0xe1, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 85 | 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 87 | 0x00, 0x1c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 88 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x0e, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 89 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x00, 90 | 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 91 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 92 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 93 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 94 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 95 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 96 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 97 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 98 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 99 | }; 100 | 101 | const unsigned char hacked[1600] = { 102 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 103 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 104 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 105 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 106 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 107 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 108 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 109 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 110 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 111 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 112 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 113 | 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 114 | 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 115 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 116 | 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 117 | 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 118 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x03, 0x00, 119 | 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 120 | 0x00, 0x00, 0xc0, 0x30, 0x7c, 0x03, 0xf3, 0x0e, 0x0f, 0x01, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 121 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0xfe, 0x07, 0xf3, 0x1c, 122 | 0x1f, 0xc3, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 123 | 0x00, 0x00, 0xc0, 0x30, 0x03, 0x0e, 0x03, 0x38, 0x30, 0xc6, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 124 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf0, 0x03, 0x0c, 0x03, 0x30, 125 | 0x30, 0x6e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 126 | 0x00, 0x00, 0xff, 0xf0, 0x1f, 0x18, 0x03, 0x60, 0x60, 0x6c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 127 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x7f, 0x18, 0x03, 0xe0, 128 | 0x7f, 0xec, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 129 | 0x00, 0x00, 0xc0, 0x30, 0xc3, 0x18, 0x03, 0xf0, 0x7f, 0xec, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 130 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x31, 0x83, 0x18, 0x03, 0x30, 131 | 0x60, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 132 | 0x00, 0x00, 0xc0, 0x31, 0x83, 0x1c, 0x03, 0x18, 0x60, 0x0e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 133 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x31, 0x87, 0x0e, 0x03, 0x1c, 134 | 0x30, 0x06, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 135 | 0x00, 0x00, 0xc0, 0x30, 0xff, 0x07, 0xf3, 0x0e, 0x1f, 0xc7, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 136 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x7b, 0x03, 0xf3, 0x07, 137 | 0x0f, 0xc1, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 138 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 139 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 140 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 142 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 143 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 144 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 145 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 146 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 147 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 148 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 149 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 150 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 151 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 152 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 153 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 154 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 155 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 156 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 157 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 158 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 159 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 160 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 161 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 162 | 0x00, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 163 | 0x00, 0x00, 0x18, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 164 | 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x60, 0x00, 0x00, 0x00, 165 | 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 166 | 0x00, 0x00, 0x18, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 167 | 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 168 | 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 169 | 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xf0, 0x01, 0xbc, 0x78, 0x30, 170 | 0x60, 0x7e, 0x33, 0xc0, 0x03, 0xcc, 0x37, 0x1f, 0x06, 0x78, 0x19, 0xe0, 0x60, 0xfc, 0x3f, 0x00, 171 | 0x00, 0x70, 0x03, 0xf8, 0x01, 0xfe, 0xfc, 0x30, 0x60, 0xfe, 0x37, 0xe0, 0x07, 0xfc, 0x3f, 0x3f, 172 | 0x86, 0xfe, 0x1b, 0xf0, 0x61, 0xfc, 0x7e, 0x00, 0x00, 0x7c, 0x06, 0x0c, 0x01, 0xc7, 0x8e, 0x30, 173 | 0x61, 0xc0, 0x38, 0x70, 0x0c, 0x1c, 0x38, 0x00, 0xc7, 0x06, 0x1c, 0x38, 0x63, 0x80, 0xc0, 0x00, 174 | 0x00, 0x1f, 0x0e, 0x0e, 0x01, 0x83, 0x06, 0x30, 0x61, 0x80, 0x30, 0x30, 0x1c, 0x0c, 0x30, 0x00, 175 | 0xc7, 0x07, 0x18, 0x18, 0x63, 0x00, 0xc0, 0x00, 0x00, 0x07, 0x8c, 0x06, 0x01, 0x83, 0x06, 0x30, 176 | 0x63, 0x00, 0x30, 0x30, 0x18, 0x0c, 0x30, 0x07, 0xc6, 0x03, 0x18, 0x18, 0x66, 0x00, 0xe0, 0x00, 177 | 0x00, 0x01, 0xcc, 0x06, 0x01, 0x83, 0x06, 0x30, 0x63, 0x00, 0x30, 0x30, 0x18, 0x0c, 0x30, 0x1f, 178 | 0xc6, 0x03, 0x18, 0x18, 0x66, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xcc, 0x06, 0x01, 0x83, 0x06, 0x30, 179 | 0x63, 0x00, 0x30, 0x30, 0x18, 0x0c, 0x30, 0x30, 0xc6, 0x03, 0x18, 0x18, 0x66, 0x00, 0x1e, 0x00, 180 | 0x00, 0x00, 0xcc, 0x06, 0x01, 0x83, 0x06, 0x30, 0x63, 0x00, 0x30, 0x30, 0x18, 0x0c, 0x30, 0x60, 181 | 0xc6, 0x03, 0x18, 0x18, 0x66, 0x00, 0x07, 0x00, 0x00, 0x00, 0xce, 0x0c, 0x01, 0x83, 0x06, 0x30, 182 | 0x63, 0x80, 0x30, 0x30, 0x1c, 0x1c, 0x30, 0x60, 0xc6, 0x07, 0x18, 0x18, 0x67, 0x00, 0x03, 0x00, 183 | 0x00, 0x81, 0x86, 0x0c, 0x01, 0x83, 0x06, 0x38, 0xe1, 0xc0, 0x30, 0x30, 0x0e, 0x1c, 0x30, 0x61, 184 | 0xc7, 0x06, 0x18, 0x18, 0x63, 0x80, 0x03, 0x00, 0x00, 0xff, 0x83, 0xf8, 0x01, 0x83, 0x06, 0x1f, 185 | 0xe0, 0xfe, 0x30, 0x30, 0x07, 0xec, 0x30, 0x3f, 0xc7, 0xfc, 0x18, 0x18, 0x61, 0xfc, 0xfe, 0x00, 186 | 0x00, 0x7e, 0x01, 0xf0, 0x01, 0x83, 0x06, 0x0e, 0x60, 0x7e, 0x30, 0x30, 0x03, 0x8c, 0x30, 0x1e, 187 | 0xc6, 0xf8, 0x18, 0x18, 0x60, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 188 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 189 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 190 | 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 191 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 192 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, 193 | 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 194 | 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 195 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 196 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 197 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 198 | 199 | }; -------------------------------------------------------------------------------- /src/lcd.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../include/lcd.h" 3 | 4 | CasioLCD::CasioLCD() : _font(NULL) 5 | { 6 | Prepare(); 7 | } 8 | 9 | void CasioLCD::Prepare() { 10 | pinMode(ON, INPUT_PULLUP); 11 | BusTristate(); 12 | gpio_set_drive_capability((gpio_num_t)D0, GPIO_DRIVE_CAP_0); 13 | gpio_set_drive_capability((gpio_num_t)D1, GPIO_DRIVE_CAP_0); 14 | gpio_set_drive_capability((gpio_num_t)D2, GPIO_DRIVE_CAP_0); 15 | gpio_set_drive_capability((gpio_num_t)D3, GPIO_DRIVE_CAP_0); 16 | gpio_set_drive_capability((gpio_num_t)D4, GPIO_DRIVE_CAP_0); 17 | gpio_set_drive_capability((gpio_num_t)D5, GPIO_DRIVE_CAP_0); 18 | gpio_set_drive_capability((gpio_num_t)D6, GPIO_DRIVE_CAP_0); 19 | gpio_set_drive_capability((gpio_num_t)D7, GPIO_DRIVE_CAP_0); 20 | 21 | gpio_set_drive_capability((gpio_num_t)DISPLAYEN, GPIO_DRIVE_CAP_0); 22 | gpio_set_drive_capability((gpio_num_t)CLOCK, GPIO_DRIVE_CAP_1); 23 | gpio_set_drive_capability((gpio_num_t)SHIFT, GPIO_DRIVE_CAP_1); 24 | gpio_set_drive_capability((gpio_num_t)MYST, GPIO_DRIVE_CAP_1); 25 | gpio_set_drive_capability((gpio_num_t)FIRST_LINE_MARKER, GPIO_DRIVE_CAP_1); 26 | 27 | } 28 | 29 | void CasioLCD::BusTristate() { 30 | pinMode(DISPLAYEN ,INPUT); 31 | pinMode(CLOCK ,INPUT); 32 | pinMode(SHIFT ,INPUT); 33 | pinMode(MYST ,INPUT); 34 | pinMode(FIRST_LINE_MARKER ,INPUT); 35 | SetBusTristate(true); 36 | pinMode(RESET, INPUT); 37 | } 38 | 39 | void CasioLCD::TakeoverBus() { 40 | digitalWrite(DISPLAYEN, HIGH); 41 | digitalWrite(RESET, LOW); 42 | digitalWrite(CLOCK, HIGH); 43 | digitalWrite(SHIFT, HIGH); 44 | digitalWrite(MYST, HIGH); 45 | digitalWrite(FIRST_LINE_MARKER, LOW); 46 | 47 | pinMode(DISPLAYEN ,OUTPUT); 48 | pinMode(RESET, OUTPUT); 49 | pinMode(CLOCK ,OUTPUT); 50 | pinMode(SHIFT ,OUTPUT); 51 | pinMode(MYST ,OUTPUT); 52 | pinMode(FIRST_LINE_MARKER, OUTPUT); 53 | } 54 | 55 | void CasioLCD::Writeframebuffer() { 56 | setCpuFrequencyMhz(240); 57 | pinMode(CLOCK ,OUTPUT); 58 | pinMode(SHIFT ,OUTPUT); 59 | pinMode(MYST ,OUTPUT); 60 | pinMode(FIRST_LINE_MARKER, OUTPUT); 61 | int x = 0; 62 | BeforeWrite(); 63 | BeginWrite(0); 64 | 65 | //The display has 64 rows 66 | for(int i = 0; i < 64; i++) { 67 | //Each Row gets 8x packets of 24xData/8bit which results in 192, our x resolution 68 | for(int j = 0; j < 8; j++) { 69 | //First 8 bits 70 | FBtoBus(x, i); 71 | WriteByte(); 72 | x += 8; 73 | //Second 8 bits 74 | FBtoBus(x, i); 75 | WriteByte(); 76 | x += 8; 77 | //3rd 8 bits 78 | FBtoBus(x, i); 79 | WriteByte(); 80 | x += 8; 81 | } 82 | x = 0; 83 | } 84 | pinMode(CLOCK ,INPUT_PULLUP); 85 | pinMode(SHIFT ,INPUT_PULLUP); 86 | pinMode(MYST ,INPUT_PULLUP); 87 | pinMode(FIRST_LINE_MARKER ,INPUT_PULLDOWN); 88 | setCpuFrequencyMhz(10); 89 | } 90 | 91 | void CasioLCD::FBtoBus(int x, int i) { 92 | SetBusTristate(false); 93 | SetBus( 94 | framebuffer[x + 0][i], 95 | framebuffer[x + 1][i], 96 | framebuffer[x + 2][i], 97 | framebuffer[x + 3][i], 98 | framebuffer[x + 4][i], 99 | framebuffer[x + 5][i], 100 | framebuffer[x + 6][i], 101 | framebuffer[x + 7][i] 102 | ); 103 | } 104 | 105 | //Writes the byte that is currently set on the bus into the lcd controller / onto the lcd 106 | void CasioLCD::WriteByte() { 107 | WriteGPIO(CLOCK, LOW); 108 | WriteGPIO(SHIFT, LOW); 109 | ets_delay_us(2); 110 | //SetBus(255); 111 | SetBusTristate(true); 112 | WriteGPIO(CLOCK, HIGH); 113 | WriteGPIO(SHIFT, HIGH); 114 | } 115 | 116 | void CasioLCD::BeginWrite(int offset) { 117 | SetBusTristate(false); 118 | SetBus(0); 119 | WriteGPIO(FIRST_LINE_MARKER, HIGH); 120 | WriteGPIO(SHIFT, LOW); 121 | WriteGPIO(FIRST_LINE_MARKER, LOW); 122 | WriteGPIO(SHIFT, HIGH); 123 | WriteGPIO(CLOCK, LOW); 124 | //ets_delay_us(1); 125 | //CHECKME: Pixels get offset when you pulse _shift? 126 | for(int i = 0; i> 7) & 0x01)); 175 | digitalWrite(D1,((bus >> 6) & 0x01)); 176 | digitalWrite(D2,((bus >> 5) & 0x01)); 177 | digitalWrite(D3,((bus >> 4) & 0x01)); 178 | digitalWrite(D4,((bus >> 3) & 0x01)); 179 | digitalWrite(D5,((bus >> 2) & 0x01)); 180 | digitalWrite(D6,((bus >> 1) & 0x01)); 181 | digitalWrite(D7,((bus >> 0) & 0x01)); 182 | 183 | //TODO: Use w1tc to set corresponding pins to 0 :P 184 | //Gpio register 185 | /*REG_WRITE(GPIO_OUT_W1TC_REG, 0xFFFFFFFF); 186 | 187 | uint32_t reg = 0; 188 | 189 | reg |= ((bus >> 0) & 0x01) << D0; 190 | reg |= ((bus >> 1) & 0x01) << D1; 191 | reg |= ((bus >> 2) & 0x01) << D2; 192 | reg |= ((bus >> 3) & 0x01) << D3; 193 | reg |= ((bus >> 4) & 0x01) << D4; 194 | reg |= ((bus >> 5) & 0x01) << D5; 195 | reg |= ((bus >> 6) & 0x01) << D6; 196 | reg |= ((bus >> 7) & 0x01) << D7; 197 | 198 | //Set values of W1TS_REG (gpio 0-32) 199 | REG_WRITE(GPIO_OUT_W1TS_REG, reg); 200 | Serial.print(reg);*/ 201 | 202 | } 203 | void CasioLCD::SetBus(int a, int b, int c, int d, int e, int f, int g, int h) { 204 | digitalWrite(D0, a); 205 | digitalWrite(D1,b); 206 | digitalWrite(D2,c); 207 | digitalWrite(D3,d); 208 | digitalWrite(D4,e); 209 | digitalWrite(D5,f); 210 | digitalWrite(D6,g); 211 | digitalWrite(D7,h); 212 | } 213 | 214 | void CasioLCD::SetBusTristate(bool state) { 215 | if(state) { 216 | pinMode(D0 ,INPUT_PULLUP); 217 | pinMode(D1 ,INPUT_PULLUP); 218 | pinMode(D2 ,INPUT_PULLUP); 219 | pinMode(D3 ,INPUT_PULLUP); 220 | pinMode(D4 ,INPUT_PULLUP); 221 | pinMode(D5 ,INPUT_PULLUP); 222 | pinMode(D6 ,INPUT_PULLUP); 223 | pinMode(D7 ,INPUT_PULLUP); 224 | } 225 | else { 226 | pinMode(D0 ,OUTPUT); 227 | pinMode(D1 ,OUTPUT); 228 | pinMode(D2 ,OUTPUT); 229 | pinMode(D3 ,OUTPUT); 230 | pinMode(D4 ,OUTPUT); 231 | pinMode(D5 ,OUTPUT); 232 | pinMode(D6 ,OUTPUT); 233 | pinMode(D7 ,OUTPUT); 234 | } 235 | } 236 | 237 | //ESP32 code 238 | void CasioLCD::WriteGPIO(int pin, bool state) { 239 | //TODO: CODE 240 | //Read gpio register 241 | 242 | digitalWrite(pin, state); 243 | //Write gpio register with mask 244 | //int reg = 0; 245 | //reg |= 1 << pin; 246 | 247 | //Push register 248 | //REG_WRITE(GPIO_OUT_W1TS_REG, 0x00010001); 249 | } 250 | 251 | //need to reverse engineer 252 | void CasioLCD::Init() { 253 | SetBus(0b00000001); 254 | WriteGPIO(SHIFT, LOW); 255 | WriteGPIO(SHIFT, HIGH); 256 | SetBus(0b00000001); 257 | WriteGPIO(CLOCK, LOW); 258 | WriteGPIO(SHIFT, LOW); 259 | WriteGPIO(CLOCK,HIGH); 260 | WriteGPIO(SHIFT, HIGH); 261 | SetBus(255); 262 | } 263 | 264 | //Need to reverse engineer 265 | void CasioLCD::setContrast(uint8_t contrast) { 266 | SetBusTristate(false); 267 | //SetBus(0b01111111); //Sets contrast 268 | 269 | WriteGPIO(SHIFT, LOW); 270 | WriteGPIO(CLOCK, LOW); 271 | WriteGPIO(MYST, LOW); 272 | //SetBus(0b10000001); TURNS OFF DISPLAY 273 | WriteGPIO(SHIFT, LOW); 274 | WriteGPIO(SHIFT, HIGH); 275 | 276 | //First the value(00h-2Ah) gets sent with CLK pulsed low 277 | SetBus(contrast); 278 | WriteGPIO(SHIFT, LOW); 279 | WriteGPIO(SHIFT, HIGH); 280 | //WriteGPIO(CLOCK, LOW); 281 | //ets_delay_us(1); 282 | //WriteGPIO(SHIFT, LOW); 283 | //ets_delay_us(1); 284 | //WriteGPIO(SHIFT, HIGH); 285 | //All high 286 | WriteGPIO(CLOCK, HIGH); 287 | WriteGPIO(SHIFT, HIGH); 288 | WriteGPIO(MYST, HIGH); 289 | //ets_delay_us(2); 290 | //SetBus(255); 291 | SetBusTristate(true); 292 | ets_delay_us(1); 293 | } 294 | 295 | void CasioLCD::setReset(bool state) { 296 | digitalWrite(RESET, state); 297 | } 298 | 299 | 300 | 301 | void CasioLCD::DrawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], 302 | int16_t w, int16_t h, bool color) { 303 | 304 | int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte 305 | uint8_t byte = 0; 306 | 307 | for (int16_t j = 0; j < h; j++, y++) { 308 | for (int16_t i = 0; i < w; i++) { 309 | if (i & 7) 310 | byte <<= 1; 311 | else 312 | byte = pgm_read_byte(&bitmap[j * byteWidth + i / 8]); 313 | if (byte & 0x80) 314 | framebuffer[x+i][y] = color; 315 | } 316 | } 317 | } 318 | 319 | void CasioLCD::ClearFB() { 320 | for(int x = 0; x<192; x++) { 321 | for(int y = 0; y<64;y++) { 322 | framebuffer[x][y] = 0; 323 | } 324 | } 325 | } 326 | 327 | 328 | void CasioLCD::textFont(const Font& which) 329 | { 330 | _font = &which; 331 | } 332 | 333 | int CasioLCD::textFontWidth() const 334 | { 335 | return (_font ? _font->width : 0); 336 | } 337 | 338 | int CasioLCD::textFontHeight() const 339 | { 340 | return (_font ? _font->height : 0); 341 | } 342 | 343 | void CasioLCD::text(const char* str, int x, int y, bool color) 344 | { 345 | if (!_font) { 346 | return; 347 | } 348 | 349 | while (*str) { 350 | int c = *str++; 351 | 352 | if (c == '\n') { 353 | y += _font->height; 354 | x = 0; 355 | } else if (c == '\r') { 356 | x = 0; 357 | } else if (c == 0xc2 || c == 0xc3) { 358 | // drop 359 | } else { 360 | const uint8_t* b = _font->data[c]; 361 | 362 | if (b == NULL) { 363 | b = _font->data[0x20]; 364 | } 365 | 366 | if (b) { 367 | bitmap(b, x, y, _font->width, _font->height, color); 368 | } 369 | 370 | x += _font->width; 371 | } 372 | } 373 | } 374 | 375 | void CasioLCD::text(const char* str, int x, int y, bool color, bool onlyfirstline) 376 | { 377 | if (!_font) { 378 | return; 379 | } 380 | 381 | while (*str) { 382 | int c = *str++; 383 | 384 | if (c == '\n') { 385 | if(onlyfirstline) return; 386 | y += _font->height; 387 | x = 0; 388 | } else if (c == '\r') { 389 | x = 0; 390 | } else if (c == 0xc2 || c == 0xc3) { 391 | // drop 392 | } else { 393 | const uint8_t* b = _font->data[c]; 394 | 395 | if (b == NULL) { 396 | b = _font->data[0x20]; 397 | } 398 | 399 | if (b) { 400 | bitmap(b, x, y, _font->width, _font->height, color); 401 | } 402 | 403 | x += _font->width; 404 | } 405 | } 406 | } 407 | 408 | void CasioLCD::rect(int x, int y, int width, int height, bool _fill) 409 | { 410 | int x1 = x; 411 | int y1 = y; 412 | int x2 = x1 + width - 1; 413 | int y2 = y1 + height - 1; 414 | 415 | for (x = x1; x <= x2; x++) { 416 | for (y = y1; y <= y2; y++) { 417 | if ((x == x1 || x == x2 || y == y1 || y == y2) && !_fill) { 418 | // stroke 419 | framebuffer[x][y] = true; 420 | } else if (_fill) { 421 | // fill 422 | framebuffer[x][y] = true; 423 | } 424 | } 425 | } 426 | } 427 | 428 | void CasioLCD::line(int x1, int y1, int x2, int y2) 429 | { 430 | 431 | if (x1 == x2) { 432 | for (int y = y1; y <= y2; y++) { 433 | framebuffer[x1][y] = true; 434 | } 435 | } else if (y1 == y2) { 436 | for (int x = x1; x <= x2; x++) { 437 | framebuffer[x][y1] = true; 438 | } 439 | } else if (abs(y2 - y1) < abs(x2 - x1)) { 440 | if (x1 > x2) { 441 | lineLow(x2, y2, x1, y1); 442 | } else { 443 | lineLow(x1, y1, x2, y2); 444 | } 445 | } else { 446 | if (y1 > y2) { 447 | lineHigh(x2, y2, x1, y1); 448 | } else { 449 | lineHigh(x1, y1, x2, y2); 450 | } 451 | } 452 | } 453 | 454 | void CasioLCD::lineHigh(int x1, int y1, int x2, int y2) 455 | { 456 | int dx = x2 - x1; 457 | int dy = y2 - y1; 458 | int xi = 1; 459 | 460 | if (dx < 0) { 461 | xi = -1; 462 | dx = -dx; 463 | } 464 | 465 | int D = 2 * dx - dy; 466 | int x = x1; 467 | 468 | for (int y = y1; y <= y2; y++) { 469 | framebuffer[x][y] = true; 470 | if (D > 0) { 471 | x += xi; 472 | D -= 2 * dy; 473 | } 474 | 475 | D += 2 * dx; 476 | } 477 | } 478 | 479 | void CasioLCD::lineLow(int x1, int y1, int x2, int y2) 480 | { 481 | int dx = x2 - x1; 482 | int dy = y2 - y1; 483 | int yi = 1; 484 | 485 | if (dy < 0) { 486 | yi = -1; 487 | dy = -dy; 488 | } 489 | 490 | int D = 2 * dy - dx; 491 | int y = y1; 492 | 493 | for (int x = x1; x <= x2; x++) { 494 | framebuffer[x][y] = true; 495 | if (D > 0) { 496 | y += yi; 497 | D -= (2 * dx); 498 | } 499 | 500 | D += (2 * dy); 501 | } 502 | } 503 | 504 | void CasioLCD::bitmap(const uint8_t* data, int x, int y, int width, int height, bool color) 505 | { 506 | if ((data == NULL) || ((x + width) < 0) || ((y + height) < 0) || (x >= 192) || (y >= 64) || ((x+width) >= 192) || (y+height) >= 64) { 507 | // offscreen 508 | //Serial.println("Bitmap out of screen"); 509 | return; 510 | } 511 | if(y == 1) {color = false;} //HACK: invert first line 512 | 513 | for (int j = 0; j < height; j++) { 514 | uint8_t b = data[j]; 515 | 516 | for (int i = 0; i < width; i++) { 517 | if (b & (1 << (7 - i))) { 518 | framebuffer[x+i][y+j] = color; 519 | } else { 520 | framebuffer[x+i][y+j] = !color; 521 | } 522 | } 523 | } 524 | } -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lcd.h" 3 | #include "../include/Keypad_MC17.h" 4 | #include 5 | #include "../include/Pages.h" 6 | #include "../include/Keyboard.h" 7 | #include "../include/bitmap.h" 8 | 9 | #include 10 | #include 11 | #include "driver/adc.h" 12 | 13 | RTC_DATA_ATTR int bootCount = 0; 14 | 15 | #define I2CADDR 0x20 16 | const byte ROWS = 7; 17 | const byte COLS = 8; 18 | //define the cymbols on the buttons of the keypads 19 | char hexaKeys[ROWS][COLS] = { 20 | {K_Xhoch, ')', '+', K_RIGHT, K_DEL, '*', K_SIN, K_DOWN}, 21 | {K_LN, K_MP, 0 , 0, 0, 0, K_TAN, K_X}, 22 | {K_LOG, K_SD, '-', K_MODE, K_AC, '/', K_COS, K_SUM}, 23 | {0, ',', '=', 0, K_10hochx, K_ANS, '0', 0}, 24 | {K_WURZEL, K_ENG,'2', K_ALPHA, '8', '5', K_ANF, K_CALC}, 25 | {K_Xquad, '(', '3', K_UP, '9', '6', K_Xhmin1, K_LEFT}, 26 | {K_BRUCH, K_STO,'1', K_SHIFT, '7', '4', K_KLA_MIN, K_OPTN}, 27 | }; 28 | byte rowPins[ROWS] = {14, 13, 12, 11, 10, 9, 8}; 29 | byte colPins[COLS] = {7, 6, 5, 4, 3, 2, 1, 0}; 30 | 31 | //initialize an instance of class NewKeypad 32 | static Keypad_MC17 CKeypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS, I2CADDR); 33 | 34 | 35 | static CasioLCD lcd; 36 | 37 | void Snake(); 38 | void DrawMainMenu(); 39 | void HandleMainEnter(); 40 | void HandleKey(char key); 41 | void DrawPage(int Page); 42 | void PagesMenu(int offset); 43 | 44 | int x = 0; 45 | int y = 0; 46 | int mainmenuindex = 0; 47 | int pagemenuindex = 0; 48 | int menuhandler = 0; 49 | int pageindex = 0; 50 | bool a = false; 51 | 52 | 53 | void setup() { 54 | adc_power_off(); 55 | WiFi.mode(WIFI_OFF); 56 | btStop(); 57 | esp_sleep_enable_ext0_wakeup(GPIO_NUM_12, 0); 58 | ++bootCount; 59 | if (bootCount <= 4) { 60 | esp_deep_sleep_start(); 61 | } else { 62 | bootCount = 1; 63 | } 64 | Serial.begin(115200); 65 | Wire.begin( ); 66 | Wire.setClock( 1700000 ); 67 | lcd.BusTristate(); 68 | lcd.textFont(Font_4x6); 69 | setCpuFrequencyMhz(10); //40mhz xtal 70 | } 71 | 72 | void loop() { 73 | if (digitalRead(ON) == LOW) { 74 | setCpuFrequencyMhz(240); 75 | delay(1000); 76 | lcd.TakeoverBus(); 77 | lcd.Writeframebuffer(); 78 | digitalWrite(17, LOW); 79 | pinMode(17, OUTPUT); 80 | pinMode(17, INPUT); 81 | CKeypad.begin(); 82 | CKeypad.setDebounceTime(1); 83 | a = true; 84 | menuhandler = 0; 85 | DrawMainMenu(); 86 | Serial.write("ON Low"); 87 | setCpuFrequencyMhz(10); 88 | } 89 | if (a) { 90 | char Key = CKeypad.getKey(); 91 | if (Key != NO_KEY){ 92 | setCpuFrequencyMhz(240); //40mhz xtal 93 | Serial.println(Key); 94 | HandleKey(Key); 95 | setCpuFrequencyMhz(10); //40mhz xtal 96 | } 97 | } 98 | } 99 | 100 | void HandleKey(char key) { 101 | //Serial.print("HandleKey | menuhandler: "); 102 | //Serial.println(menuhandler); 103 | if(menuhandler == 0) { 104 | switch(key) { 105 | case K_UP: 106 | if(mainmenuindex > 0) mainmenuindex--; 107 | DrawMainMenu(); 108 | break; 109 | case K_DOWN: 110 | if(mainmenuindex < 4) mainmenuindex++; 111 | DrawMainMenu(); 112 | break; 113 | case '=': 114 | HandleMainEnter(); 115 | break; 116 | default: 117 | break; 118 | } 119 | return; 120 | } 121 | if(menuhandler == 1) { 122 | switch(key) { 123 | case K_LEFT: 124 | if(pageindex > 0) pageindex--; 125 | DrawPage(pageindex); 126 | break; 127 | case K_RIGHT: 128 | if(pageindex < PAGECOUNT - 1) pageindex++; 129 | DrawPage(pageindex); 130 | break; 131 | case K_UP: 132 | menuhandler = 0; 133 | DrawMainMenu(); 134 | break; 135 | case K_AC: 136 | case '=': 137 | CKeypad.end(); 138 | lcd.BusTristate(); 139 | a = false; 140 | bootCount = 0; 141 | esp_deep_sleep_start(); 142 | //HandleMainEnter(); 143 | break; 144 | default: 145 | break; 146 | } 147 | return; 148 | } 149 | if(menuhandler == 2) { 150 | switch(key) { 151 | case K_UP: 152 | if(pagemenuindex > 0) pagemenuindex--; 153 | PagesMenu(pagemenuindex/10); 154 | break; 155 | case K_DOWN: 156 | if(pagemenuindex < PAGECOUNT - 1) pagemenuindex++; 157 | PagesMenu(pagemenuindex/10); 158 | break; 159 | case '=': 160 | DrawPage(pagemenuindex); 161 | break; 162 | case K_AC: 163 | menuhandler = 0; 164 | DrawMainMenu(); 165 | default: 166 | break; 167 | } 168 | return; 169 | } 170 | } 171 | 172 | void HandleMainEnter() { 173 | //Serial.print("HandleMainEnter: "); 174 | //Serial.println(mainmenuindex); 175 | switch(mainmenuindex) { 176 | case 0: //Exit 177 | CKeypad.end(); 178 | lcd.BusTristate(); 179 | a = false; 180 | break; 181 | case 1: 182 | CKeypad.end(); 183 | lcd.BusTristate(); 184 | a = false; 185 | bootCount = 0; 186 | esp_deep_sleep_start(); 187 | break; 188 | case 2: 189 | menuhandler = 1; 190 | DrawPage(0); 191 | break; 192 | case 3: 193 | menuhandler = 2; 194 | pagemenuindex = 0; 195 | PagesMenu(0); 196 | break; 197 | case 4: 198 | Snake(); 199 | 200 | default: 201 | break; 202 | } 203 | } 204 | 205 | void Snake() { 206 | /*lcd.ClearFB(); 207 | lcd.rect(0,3,192,64, true); 208 | lcd.textFont(Font_5x7); 209 | lcd.text("S N A K E", 70, 30, false); 210 | lcd.text("---------", 70, 38, false); 211 | lcd.Writeframebuffer(); 212 | vTaskDelay(2000);*/ 213 | 214 | int plx = 10; 215 | int ply = 10; 216 | CKeypad.setDebounceTime(1); 217 | 218 | while(true) { 219 | CKeypad.getKeys(); 220 | for (int i=0; i 7 | #include 8 | #include "bitmap.h" 9 | 10 | const int _OnPin = 12; 11 | 12 | //Reset pin (P151) 13 | const int _resetcalc = 13; //channel 0 14 | 15 | //Solder on wires onto testpads from left side to right side 16 | const int _displayen = 18; //channel 1 17 | const int _clock = 14; // channel 2 18 | const int _shift = 27; //channel 3 //CS line?! Low->Instruction Register(write) | High->Data Register 19 | const int _myst = 26; //channel 4 20 | const int _begin = 25; //channel 5 21 | 22 | const int _pins[8] = {2,15 ,4 ,16,19,23,32,33}; //D0-D7 23 | 24 | void disableProc(); 25 | void enableProc(); 26 | void restartProc(); 27 | void setTristate(); 28 | void initlcd(); 29 | void setbus(int a, int b, int c, int d, int e, int f, int g, int h); 30 | void setbus(uint8_t* arr); 31 | void beforewrite(); 32 | void write(); 33 | void write_dip(); 34 | 35 | void test(); 36 | void setOutput(); 37 | void beginwrite(int offset); 38 | void gpioMode(uint8_t gpio, uint8_t mode); 39 | void drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, bool color); 40 | 41 | void badapple(); 42 | 43 | bool framebuffer[192][64]; 44 | //std::array, 192> framebuffer; //Luca, plz stop this is a poc 45 | int xwert = 0; 46 | 47 | #define BUF_SIZE 1536//504 48 | uint8_t buf[BUF_SIZE]; 49 | void clear(); 50 | uint32_t pos = 0; 51 | void serialEvent(); 52 | void drawBitmap_RAM(int16_t x, uint16_t y, uint8_t* bitmap, int16_t sx, uint16_t sy, bool color); 53 | 54 | void setup() { 55 | //drawBitmap(0,0,BMP,192,64,true); 56 | /*framebuffer[61][191] = true; 57 | framebuffer[61][189] = true; 58 | framebuffer[61][186] = true; 59 | framebuffer[61][184] = true; 60 | */ 61 | pinMode(_OnPin, INPUT_PULLUP); 62 | 63 | restartProc(); 64 | delay(2000); 65 | digitalWrite(_displayen, HIGH); 66 | digitalWrite(_myst, HIGH); 67 | pinMode(_myst, OUTPUT); 68 | pinMode(_displayen, OUTPUT); 69 | setOutput(); 70 | disableProc(); 71 | delay(2000); 72 | //test(); 73 | 74 | Serial.begin(153600); 75 | 76 | clear(); 77 | 78 | while (Serial.available()) 79 | Serial.read(); 80 | 81 | Serial.write(0xfe); // Tell server that we are ready to receive 82 | } 83 | 84 | void loop() { 85 | //delay(1000); 86 | //drawBitmap(0,0,hacked,192,64,true); 87 | //test(); 88 | //delay(1000); 89 | /*if (digitalRead(_OnPin) == LOW) { 90 | for(int x = 0; x<192; x++) { 91 | for(int y = 0; y<64;y++) { 92 | framebuffer[x][y] = 0; 93 | } 94 | } 95 | drawBitmap(0,0,hacked,192,64,true); 96 | test(); 97 | }*/ 98 | badapple(); 99 | } 100 | 101 | void badapple() { 102 | for(int x = 0; x<192; x++) { 103 | for(int y = 0; y<64;y++) { 104 | framebuffer[x][y] = 0; 105 | } 106 | } 107 | //drawBitmap(0,0,BMP,192,64,true); 108 | 109 | if (Serial.available()) 110 | serialEvent(); 111 | 112 | if (pos < BUF_SIZE) 113 | return; 114 | 115 | Serial.write(0xFE); // Tell server that we are ready for next frame 116 | 117 | drawBitmap_RAM(0, 0, buf, 192, 64, false); 118 | 119 | test(); 120 | 121 | pos = 0; 122 | } 123 | 124 | void test() { 125 | beforewrite(); 126 | //ets_delay_us(500); 127 | beginwrite(0); 128 | ets_delay_us(5); 129 | for(int i = 0; i <64; i++) { 130 | for(int j = 0; j < 8; j++) { 131 | ets_delay_us(1); 132 | //setbus(framebuffer[i] + xwert); 133 | setbus( 134 | framebuffer[xwert][i], 135 | framebuffer[xwert + 1][i], 136 | framebuffer[xwert + 2][i], 137 | framebuffer[xwert + 3][i], 138 | framebuffer[xwert + 4][i], 139 | framebuffer[xwert + 5][i], 140 | framebuffer[xwert + 6][i], 141 | framebuffer[xwert + 7][i] 142 | ); 143 | write(); 144 | ets_delay_us(1); 145 | setbus( 146 | framebuffer[xwert + 8][i], 147 | framebuffer[xwert + 1 + 8][i], 148 | framebuffer[xwert + 2 + 8][i], 149 | framebuffer[xwert + 3 + 8][i], 150 | framebuffer[xwert + 4 + 8][i], 151 | framebuffer[xwert + 5 + 8][i], 152 | framebuffer[xwert + 6 + 8][i], 153 | framebuffer[xwert + 7 + 8][i] 154 | ); 155 | write(); 156 | ets_delay_us(1); 157 | setbus( 158 | framebuffer[xwert + 0 + 16][i], 159 | framebuffer[xwert + 1 + 16][i], 160 | framebuffer[xwert + 2 + 16][i], 161 | framebuffer[xwert + 3 + 16][i], 162 | framebuffer[xwert + 4 + 16][i], 163 | framebuffer[xwert + 5 + 16][i], 164 | framebuffer[xwert + 6 + 16][i], 165 | framebuffer[xwert + 7 + 16][i] 166 | ); 167 | write(); 168 | xwert = xwert + 24; 169 | } 170 | xwert = 0; 171 | ets_delay_us(10); 172 | } 173 | } 174 | 175 | void write() { 176 | digitalWrite(_clock, 0); 177 | digitalWrite(_shift, 0); 178 | ets_delay_us(2); 179 | setbus(1,1,1,1,1,1,1,1); 180 | digitalWrite(_clock, 1); 181 | digitalWrite(_shift, 1); 182 | } 183 | 184 | void write_dip() { 185 | setbus(0,0,0,0,0,0,0,0); 186 | digitalWrite(_clock, 0); 187 | digitalWrite(_shift, 0); 188 | digitalWrite(_myst, 0); 189 | ets_delay_us(1); 190 | digitalWrite(_myst, 1); 191 | ets_delay_us(2); 192 | setbus(1,1,1,1,1,1,1,1); 193 | digitalWrite(_clock, 1); 194 | digitalWrite(_shift, 1); 195 | } 196 | 197 | void beginwrite(int offset) { 198 | setbus(0,0,0,0,0,0,0,0); 199 | digitalWrite(_begin, 1); 200 | ets_delay_us(1); 201 | digitalWrite(_shift, 0); 202 | ets_delay_us(1); 203 | digitalWrite(_begin, 0); 204 | digitalWrite(_shift, 1); 205 | digitalWrite(_clock, 0); 206 | ets_delay_us(1); 207 | //CHECKME: Pixels get offset when you pulse _shift? 208 | for(int i = 0; i0) 339 | framebuffer[x+cx][y+cy] = color; 340 | else 341 | framebuffer[x+cx][y+cy] = !color; 342 | } 343 | }*/ 344 | int16_t byteWidth = (sx + 7) / 8; // Bitmap scanline pad = whole byte 345 | uint8_t byte = 0; 346 | 347 | for (int16_t j = 0; j < sy; j++, y++) { 348 | for (int16_t i = 0; i < sx; i++) { 349 | if (i & 7) 350 | byte <<= 1; 351 | else 352 | byte = bitmap[j * byteWidth + i / 8]; 353 | if (byte & 0x80) 354 | framebuffer[x+i][y] = true; 355 | } 356 | } 357 | } 358 | 359 | void clear() 360 | { 361 | for (uint16_t i = 0; i < BUF_SIZE; i++) 362 | buf[i] = 0; 363 | } 364 | 365 | void serialEvent() 366 | { 367 | while (Serial.available()) { 368 | byte b = Serial.read(); 369 | if (pos < BUF_SIZE) 370 | buf[pos++] = b; 371 | } 372 | } -------------------------------------------------------------------------------- /src/snake.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DSchndr/classwiz_lcd/c181748f75bba632589b0d61567cd9a148dfbff8/src/snake.cpp -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | --------------------------------------------------------------------------------