├── Arduino_ST7735_Fast.cpp ├── Arduino_ST7735_Fast.h ├── LICENSE ├── README.md ├── README.txt ├── examples ├── ST7735_AdafruitBenchmark │ └── ST7735_AdafruitBenchmark.ino ├── ST7735_AmigaBall │ ├── ST7735_AmigaBall.ino │ └── ball.h ├── ST7735_BigScroll │ └── ST7735_BigScroll.ino ├── ST7735_Bitmap │ ├── ST7735_Bitmap.ino │ └── bitmap.h ├── ST7735_ControllerModes │ └── ST7735_ControllerModes.ino ├── ST7735_Gauges │ └── ST7735_Gauges.ino ├── ST7735_HelloWorld │ └── ST7735_HelloWorld.ino ├── ST7735_Lines │ └── ST7735_Lines.ino ├── ST7735_Mario_RRE │ ├── ST7735_Mario_RRE.ino │ ├── rre_mario0.h │ ├── rre_mario0_v.h │ ├── rre_mario1.h │ ├── rre_mario2.h │ ├── rre_mario2_v.h │ ├── rre_mario3.h │ ├── rre_mario3_v.h │ ├── rre_mario4.h │ ├── rre_mario4_v.h │ ├── rre_mario5.h │ ├── rre_mario5_v.h │ ├── rre_mario6.h │ └── rre_mario6_v.h ├── ST7735_MovingText │ └── ST7735_MovingText.ino ├── ST7735_Rotation │ └── ST7735_Rotation.ino └── ST7735_Scroll │ └── ST7735_Scroll.ino ├── keywords.txt └── library.properties /Arduino_ST7735_Fast.cpp: -------------------------------------------------------------------------------- 1 | // Fast ST7735 128x160 1.8" display library 2 | // (c) 2019 by Pawel A. Hernik 3 | 4 | #include "Arduino_ST7735_Fast.h" 5 | #include 6 | #include "pins_arduino.h" 7 | #include "wiring_private.h" 8 | #include 9 | 10 | // Initialization commands for ST7735 128x160 1.8" IPS 11 | // taken from Adafruit 12 | static const uint8_t PROGMEM 13 | Rcmd1[] = { // 7735R init, part 1 (red or green tab) 14 | 15, // 15 commands in list: 15 | ST7735_SWRESET, ST_CMD_DELAY, // 1: Software reset, 0 args, w/delay 16 | 150, // 150 ms delay 17 | ST7735_SLPOUT, ST_CMD_DELAY, // 2: Out of sleep mode, 0 args, w/delay 18 | 255, // 500 ms delay 19 | ST7735_FRMCTR1, 3, // 3: Framerate ctrl - normal mode, 3 arg: 20 | 0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D) 21 | ST7735_FRMCTR2, 3, // 4: Framerate ctrl - idle mode, 3 args: 22 | 0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D) 23 | ST7735_FRMCTR3, 6, // 5: Framerate - partial mode, 6 args: 24 | 0x01, 0x2C, 0x2D, // Dot inversion mode 25 | 0x01, 0x2C, 0x2D, // Line inversion mode 26 | ST7735_INVCTR, 1, // 6: Display inversion ctrl, 1 arg: 27 | 0x07, // No inversion 28 | ST7735_PWCTR1, 3, // 7: Power control, 3 args, no delay: 29 | 0xA2, 30 | 0x02, // -4.6V 31 | 0x84, // AUTO mode 32 | ST7735_PWCTR2, 1, // 8: Power control, 1 arg, no delay: 33 | 0xC5, // VGH25=2.4C VGSEL=-10 VGH=3 * AVDD 34 | ST7735_PWCTR3, 2, // 9: Power control, 2 args, no delay: 35 | 0x0A, // Opamp current small 36 | 0x00, // Boost frequency 37 | ST7735_PWCTR4, 2, // 10: Power control, 2 args, no delay: 38 | 0x8A, // BCLK/2, 39 | 0x2A, // opamp current small & medium low 40 | ST7735_PWCTR5, 2, // 11: Power control, 2 args, no delay: 41 | 0x8A, 0xEE, 42 | ST7735_VMCTR1, 1, // 12: Power control, 1 arg, no delay: 43 | 0x0E, 44 | ST7735_INVOFF, 0, // 13: Don't invert display, no args 45 | ST7735_MADCTL, 1, // 14: Mem access ctl (directions), 1 arg: 46 | 0xC8, // row/col addr, bottom-top refresh 47 | ST7735_COLMOD, 1, // 15: set color mode, 1 arg, no delay: 48 | 0x05 }, 49 | 50 | Rcmd2red[] = { // 7735R init, part 2 (red tab only) 51 | 2, // 2 commands in list: 52 | ST7735_CASET, 4, // 1: Column addr set, 4 args, no delay: 53 | 0x00, 0x00, // XSTART = 0 54 | 0x00, 0x7F, // XEND = 127 55 | ST7735_RASET, 4, // 2: Row addr set, 4 args, no delay: 56 | 0x00, 0x00, // XSTART = 0 57 | 0x00, 0x9F }, 58 | 59 | Rcmd3[] = { // 7735R init, part 3 (red or green tab) 60 | 4, // 4 commands in list: 61 | ST7735_GMCTRP1, 16 , // 1: Gamma Adjustments (pos. polarity), 16 args + delay: 62 | 0x02, 0x1c, 0x07, 0x12, // (Not entirely necessary, but provides 63 | 0x37, 0x32, 0x29, 0x2d, // accurate colors) 64 | 0x29, 0x25, 0x2B, 0x39, 65 | 0x00, 0x01, 0x03, 0x10, 66 | ST7735_GMCTRN1, 16 , // 2: Gamma Adjustments (neg. polarity), 16 args + delay: 67 | 0x03, 0x1d, 0x07, 0x06, // (Not entirely necessary, but provides 68 | 0x2E, 0x2C, 0x29, 0x2D, // accurate colors) 69 | 0x2E, 0x2E, 0x37, 0x3F, 70 | 0x00, 0x00, 0x02, 0x10, 71 | ST7735_NORON, ST_CMD_DELAY, // 3: Normal display on, no args, w/delay 72 | 10, // 10 ms delay 73 | ST7735_DISPON, ST_CMD_DELAY, // 4: Main screen turn on, no args w/delay 74 | 100 }; 75 | 76 | #ifdef COMPATIBILITY_MODE 77 | static SPISettings spiSettings; 78 | #define SPI_START SPI.beginTransaction(spiSettings) 79 | #define SPI_END SPI.endTransaction() 80 | #else 81 | #define SPI_START 82 | #define SPI_END 83 | #endif 84 | 85 | // macros for fast DC and CS state changes 86 | #ifdef COMPATIBILITY_MODE 87 | #define DC_DATA digitalWrite(dcPin, HIGH) 88 | #define DC_COMMAND digitalWrite(dcPin, LOW) 89 | #define CS_IDLE digitalWrite(csPin, HIGH) 90 | #define CS_ACTIVE digitalWrite(csPin, LOW) 91 | #else 92 | #define DC_DATA *dcPort |= dcMask 93 | #define DC_COMMAND *dcPort &= ~dcMask 94 | #define CS_IDLE *csPort |= csMask 95 | #define CS_ACTIVE *csPort &= ~csMask 96 | #endif 97 | 98 | // if CS always connected to the ground then don't do anything for better performance 99 | #ifdef CS_ALWAYS_LOW 100 | #define CS_IDLE 101 | #define CS_ACTIVE 102 | #endif 103 | 104 | // ---------------------------------------------------------- 105 | // speed test results: 106 | // in AVR best performance mode -> about 6.9 Mbps 107 | // in compatibility mode (SPI.transfer(c)) -> about 4 Mbps 108 | inline void Arduino_ST7735::writeSPI(uint8_t c) 109 | { 110 | #ifdef COMPATIBILITY_MODE 111 | SPI.transfer(c); 112 | #else 113 | SPDR = c; 114 | asm volatile("nop"); // 8 NOPs seem to be enough for 16MHz AVR @ DIV2 to avoid using while loop 115 | asm volatile("nop"); 116 | asm volatile("nop"); 117 | asm volatile("nop"); 118 | asm volatile("nop"); 119 | asm volatile("nop"); 120 | asm volatile("nop"); 121 | asm volatile("nop"); 122 | //while(!(SPSR & _BV(SPIF))) ; 123 | #endif 124 | } 125 | 126 | // ---------------------------------------------------------- 127 | Arduino_ST7735::Arduino_ST7735(int8_t dc, int8_t rst, int8_t cs) : Adafruit_GFX(ST7735_TFTWIDTH, ST7735_TFTHEIGHT) 128 | { 129 | csPin = cs; 130 | dcPin = dc; 131 | rstPin = rst; 132 | } 133 | 134 | // ---------------------------------------------------------- 135 | void Arduino_ST7735::init() 136 | { 137 | pinMode(dcPin, OUTPUT); 138 | #ifndef CS_ALWAYS_LOW 139 | pinMode(csPin, OUTPUT); 140 | #endif 141 | 142 | #ifndef COMPATIBILITY_MODE 143 | dcPort = portOutputRegister(digitalPinToPort(dcPin)); 144 | dcMask = digitalPinToBitMask(dcPin); 145 | #ifndef CS_ALWAYS_LOW 146 | csPort = portOutputRegister(digitalPinToPort(csPin)); 147 | csMask = digitalPinToBitMask(csPin); 148 | #endif 149 | #endif 150 | 151 | SPI.begin(); 152 | #ifdef COMPATIBILITY_MODE 153 | spiSettings = SPISettings(16000000, MSBFIRST, SPI_MODE3); // 8000000 gives max speed on AVR 16MHz 154 | #else 155 | SPI.setClockDivider(SPI_CLOCK_DIV2); 156 | SPI.setDataMode(SPI_MODE3); 157 | #endif 158 | 159 | CS_ACTIVE; 160 | if(rstPin != -1) { 161 | pinMode(rstPin, OUTPUT); 162 | digitalWrite(rstPin, HIGH); 163 | delay(50); 164 | digitalWrite(rstPin, LOW); 165 | delay(50); 166 | digitalWrite(rstPin, HIGH); 167 | delay(50); 168 | } 169 | 170 | _colstart = 0; 171 | _rowstart = 0; 172 | _width = ST7735_TFTWIDTH; 173 | _height = ST7735_TFTHEIGHT; 174 | displayInit(Rcmd1); 175 | displayInit(Rcmd2red); 176 | displayInit(Rcmd3); 177 | setRotation(2); 178 | } 179 | 180 | // ---------------------------------------------------------- 181 | void Arduino_ST7735::writeCmd(uint8_t c) 182 | { 183 | DC_COMMAND; 184 | CS_ACTIVE; 185 | SPI_START; 186 | 187 | writeSPI(c); 188 | 189 | CS_IDLE; 190 | SPI_END; 191 | } 192 | 193 | // ---------------------------------------------------------- 194 | void Arduino_ST7735::writeData(uint8_t c) 195 | { 196 | DC_DATA; 197 | CS_ACTIVE; 198 | SPI_START; 199 | 200 | writeSPI(c); 201 | 202 | CS_IDLE; 203 | SPI_END; 204 | } 205 | 206 | // ---------------------------------------------------------- 207 | void Arduino_ST7735::displayInit(const uint8_t *addr) 208 | { 209 | uint8_t numCommands, numArgs; 210 | uint16_t ms; 211 | numCommands = pgm_read_byte(addr++); // Number of commands to follow 212 | while(numCommands--) { // For each command... 213 | writeCmd(pgm_read_byte(addr++)); // Read, issue command 214 | numArgs = pgm_read_byte(addr++); // Number of args to follow 215 | ms = numArgs & ST_CMD_DELAY; // If hibit set, delay follows args 216 | numArgs &= ~ST_CMD_DELAY; // Mask out delay bit 217 | while(numArgs--) writeData(pgm_read_byte(addr++)); 218 | 219 | if(ms) { 220 | ms = pgm_read_byte(addr++); // Read post-command delay time (ms) 221 | if(ms == 255) ms = 500; // If 255, delay for 500 ms 222 | delay(ms); 223 | } 224 | } 225 | } 226 | 227 | 228 | // ---------------------------------------------------------- 229 | void Arduino_ST7735::setRotation(uint8_t m) 230 | { 231 | writeCmd(ST7735_MADCTL); 232 | rotation = m & 3; 233 | switch (rotation) { 234 | case 0: 235 | writeData(ST7735_MADCTL_MX | ST7735_MADCTL_MY | ST7735_MADCTL_RGB); 236 | _xstart = _colstart; 237 | _ystart = _rowstart; 238 | _height = ST7735_TFTHEIGHT; 239 | _width = ST7735_TFTWIDTH; 240 | break; 241 | case 1: 242 | writeData(ST7735_MADCTL_MY | ST7735_MADCTL_MV | ST7735_MADCTL_RGB); 243 | _ystart = _colstart; 244 | _xstart = _rowstart; 245 | _width = ST7735_TFTHEIGHT; 246 | _height = ST7735_TFTWIDTH; 247 | break; 248 | case 2: 249 | writeData(ST7735_MADCTL_RGB); 250 | _xstart = _colstart; 251 | _ystart = _rowstart; 252 | _height = ST7735_TFTHEIGHT; 253 | _width = ST7735_TFTWIDTH; 254 | break; 255 | case 3: 256 | writeData(ST7735_MADCTL_MX | ST7735_MADCTL_MV | ST7735_MADCTL_RGB); 257 | _ystart = _colstart; 258 | _xstart = _rowstart; 259 | _width = ST7735_TFTHEIGHT; 260 | _height = ST7735_TFTWIDTH; 261 | break; 262 | } 263 | } 264 | 265 | // ---------------------------------------------------------- 266 | void Arduino_ST7735::setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) 267 | { 268 | uint16_t xs = x0 + _xstart, xe = x1 + _xstart; 269 | uint16_t ys = y0 + _ystart, ye = y1 + _ystart; 270 | // optimized version 271 | CS_ACTIVE; 272 | SPI_START; 273 | 274 | DC_COMMAND; writeSPI(ST7735_CASET); 275 | DC_DATA; 276 | writeSPI(xs >> 8); writeSPI(xs & 0xFF); 277 | writeSPI(xe >> 8); writeSPI(xe & 0xFF); 278 | 279 | DC_COMMAND; writeSPI(ST7735_RASET); 280 | DC_DATA; 281 | writeSPI(ys >> 8); writeSPI(ys & 0xFF); 282 | writeSPI(ye >> 8); writeSPI(ye & 0xFF); 283 | 284 | DC_COMMAND; writeSPI(ST7735_RAMWR); 285 | 286 | CS_IDLE; 287 | SPI_END; 288 | } 289 | 290 | // ---------------------------------------------------------- 291 | void Arduino_ST7735::pushColor(uint16_t color) 292 | { 293 | SPI_START; 294 | DC_DATA; 295 | CS_ACTIVE; 296 | 297 | writeSPI(color >> 8); writeSPI(color); 298 | 299 | CS_IDLE; 300 | SPI_END; 301 | } 302 | 303 | // ---------------------------------------------------------- 304 | void Arduino_ST7735::drawPixel(int16_t x, int16_t y, uint16_t color) 305 | { 306 | if(x<0 ||x>=_width || y<0 || y>=_height) return; 307 | setAddrWindow(x,y,x+1,y+1); 308 | 309 | SPI_START; 310 | DC_DATA; 311 | CS_ACTIVE; 312 | 313 | writeSPI(color >> 8); writeSPI(color); 314 | 315 | CS_IDLE; 316 | SPI_END; 317 | } 318 | 319 | // ---------------------------------------------------------- 320 | void Arduino_ST7735::drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) 321 | { 322 | if(x>=_width || y>=_height || h<=0) return; 323 | if(y+h-1>=_height) h=_height-y; 324 | setAddrWindow(x, y, x, y+h-1); 325 | 326 | uint8_t hi = color >> 8, lo = color; 327 | 328 | SPI_START; 329 | DC_DATA; 330 | CS_ACTIVE; 331 | 332 | uint8_t num8 = h>>3; 333 | while(num8--) { 334 | writeSPI(hi); writeSPI(lo); 335 | writeSPI(hi); writeSPI(lo); 336 | writeSPI(hi); writeSPI(lo); 337 | writeSPI(hi); writeSPI(lo); 338 | writeSPI(hi); writeSPI(lo); 339 | writeSPI(hi); writeSPI(lo); 340 | writeSPI(hi); writeSPI(lo); 341 | writeSPI(hi); writeSPI(lo); 342 | } 343 | num8 = (uint8_t)h & 7; 344 | while(num8--) { writeSPI(hi); writeSPI(lo); } 345 | 346 | CS_IDLE; 347 | SPI_END; 348 | } 349 | 350 | // ---------------------------------------------------------- 351 | void Arduino_ST7735::drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) 352 | { 353 | if(x>=_width || y>=_height || w<=0) return; 354 | if(x+w-1>=_width) w=_width-x; 355 | setAddrWindow(x, y, x+w-1, y); 356 | 357 | uint8_t hi = color >> 8, lo = color; 358 | 359 | SPI_START; 360 | DC_DATA; 361 | CS_ACTIVE; 362 | 363 | uint8_t num8 = w>>3; 364 | while(num8--) { 365 | writeSPI(hi); writeSPI(lo); 366 | writeSPI(hi); writeSPI(lo); 367 | writeSPI(hi); writeSPI(lo); 368 | writeSPI(hi); writeSPI(lo); 369 | writeSPI(hi); writeSPI(lo); 370 | writeSPI(hi); writeSPI(lo); 371 | writeSPI(hi); writeSPI(lo); 372 | writeSPI(hi); writeSPI(lo); 373 | } 374 | num8 = (uint8_t)w & 7; 375 | while(num8--) { writeSPI(hi); writeSPI(lo); } 376 | 377 | CS_IDLE; 378 | SPI_END; 379 | } 380 | 381 | // ---------------------------------------------------------- 382 | void Arduino_ST7735::fillScreen(uint16_t color) 383 | { 384 | fillRect(0, 0, _width, _height, color); 385 | } 386 | 387 | // ---------------------------------------------------------- 388 | void Arduino_ST7735::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) 389 | { 390 | if(x>=_width || y>=_height || w<=0 || h<=0) return; 391 | if(x+w-1>=_width) w=_width -x; 392 | if(y+h-1>=_height) h=_height-y; 393 | setAddrWindow(x, y, x+w-1, y+h-1); 394 | 395 | uint8_t hi = color >> 8, lo = color; 396 | 397 | SPI_START; 398 | DC_DATA; 399 | CS_ACTIVE; 400 | 401 | uint32_t num = (uint32_t)w*h; 402 | uint16_t num16 = num>>4; 403 | while(num16--) { 404 | writeSPI(hi); writeSPI(lo); 405 | writeSPI(hi); writeSPI(lo); 406 | writeSPI(hi); writeSPI(lo); 407 | writeSPI(hi); writeSPI(lo); 408 | writeSPI(hi); writeSPI(lo); 409 | writeSPI(hi); writeSPI(lo); 410 | writeSPI(hi); writeSPI(lo); 411 | writeSPI(hi); writeSPI(lo); 412 | writeSPI(hi); writeSPI(lo); 413 | writeSPI(hi); writeSPI(lo); 414 | writeSPI(hi); writeSPI(lo); 415 | writeSPI(hi); writeSPI(lo); 416 | writeSPI(hi); writeSPI(lo); 417 | writeSPI(hi); writeSPI(lo); 418 | writeSPI(hi); writeSPI(lo); 419 | writeSPI(hi); writeSPI(lo); 420 | } 421 | uint8_t num8 = num & 0xf; 422 | while(num8--) { writeSPI(hi); writeSPI(lo); } 423 | 424 | CS_IDLE; 425 | SPI_END; 426 | } 427 | 428 | // ---------------------------------------------------------- 429 | // draws image from RAM 430 | void Arduino_ST7735::drawImage(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t *img16) 431 | { 432 | if(x>=_width || y>=_height || w<=0 || h<=0) return; 433 | setAddrWindow(x, y, x+w-1, y+h-1); 434 | 435 | SPI_START; 436 | DC_DATA; 437 | CS_ACTIVE; 438 | 439 | uint32_t num = (uint32_t)w*h; 440 | uint16_t num16 = num>>3; 441 | uint8_t *img = (uint8_t *)img16; 442 | while(num16--) { 443 | writeSPI(*(img+1)); writeSPI(*(img+0)); img+=2; 444 | writeSPI(*(img+1)); writeSPI(*(img+0)); img+=2; 445 | writeSPI(*(img+1)); writeSPI(*(img+0)); img+=2; 446 | writeSPI(*(img+1)); writeSPI(*(img+0)); img+=2; 447 | writeSPI(*(img+1)); writeSPI(*(img+0)); img+=2; 448 | writeSPI(*(img+1)); writeSPI(*(img+0)); img+=2; 449 | writeSPI(*(img+1)); writeSPI(*(img+0)); img+=2; 450 | writeSPI(*(img+1)); writeSPI(*(img+0)); img+=2; 451 | } 452 | uint8_t num8 = num & 0x7; 453 | while(num8--) { writeSPI(*(img+1)); writeSPI(*(img+0)); img+=2; } 454 | 455 | CS_IDLE; 456 | SPI_END; 457 | } 458 | 459 | // ---------------------------------------------------------- 460 | // draws image from flash (PROGMEM) 461 | void Arduino_ST7735::drawImageF(int16_t x, int16_t y, int16_t w, int16_t h, const uint16_t *img16) 462 | { 463 | if(x>=_width || y>=_height || w<=0 || h<=0) return; 464 | setAddrWindow(x, y, x+w-1, y+h-1); 465 | 466 | SPI_START; 467 | DC_DATA; 468 | CS_ACTIVE; 469 | 470 | uint32_t num = (uint32_t)w*h; 471 | uint16_t num16 = num>>3; 472 | uint8_t *img = (uint8_t *)img16; 473 | while(num16--) { 474 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; 475 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; 476 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; 477 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; 478 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; 479 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; 480 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; 481 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; 482 | } 483 | uint8_t num8 = num & 0x7; 484 | while(num8--) { writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; } 485 | 486 | CS_IDLE; 487 | SPI_END; 488 | } 489 | 490 | // ---------------------------------------------------------- 491 | // Pass 8-bit (each) R,G,B, get back 16-bit packed color 492 | uint16_t Arduino_ST7735::Color565(uint8_t r, uint8_t g, uint8_t b) 493 | { 494 | return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3); 495 | } 496 | 497 | // ---------------------------------------------------------- 498 | void Arduino_ST7735::invertDisplay(boolean mode) 499 | { 500 | writeCmd(mode ? ST7735_INVON : ST7735_INVOFF); 501 | } 502 | 503 | // ---------------------------------------------------------- 504 | void Arduino_ST7735::partialDisplay(boolean mode) 505 | { 506 | writeCmd(mode ? ST7735_PTLON : ST7735_NORON); 507 | } 508 | 509 | // ---------------------------------------------------------- 510 | void Arduino_ST7735::sleepDisplay(boolean mode) 511 | { 512 | writeCmd(mode ? ST7735_SLPIN : ST7735_SLPOUT); 513 | delay(5); 514 | } 515 | 516 | // ---------------------------------------------------------- 517 | void Arduino_ST7735::enableDisplay(boolean mode) 518 | { 519 | writeCmd(mode ? ST7735_DISPON : ST7735_DISPOFF); 520 | } 521 | 522 | // ---------------------------------------------------------- 523 | void Arduino_ST7735::idleDisplay(boolean mode) 524 | { 525 | writeCmd(mode ? ST7735_IDMON : ST7735_IDMOFF); 526 | } 527 | 528 | // ---------------------------------------------------------- 529 | void Arduino_ST7735::resetDisplay() 530 | { 531 | writeCmd(ST7735_SWRESET); 532 | delay(5); 533 | } 534 | 535 | // ---------------------------------------------------------- 536 | void Arduino_ST7735::setScrollArea(uint16_t tfa, uint16_t bfa) 537 | { 538 | uint16_t vsa = 160-tfa-bfa; 539 | writeCmd(ST7735_VSCRDEF); 540 | writeData(tfa >> 8); writeData(tfa); 541 | writeData(vsa >> 8); writeData(vsa); 542 | writeData(bfa >> 8); writeData(bfa); 543 | } 544 | 545 | // ---------------------------------------------------------- 546 | void Arduino_ST7735::setScroll(uint16_t vsp) 547 | { 548 | writeCmd(ST7735_VSCRSADD); 549 | writeData(vsp >> 8); writeData(vsp); 550 | } 551 | 552 | // ---------------------------------------------------------- 553 | void Arduino_ST7735::setPartArea(uint16_t sr, uint16_t er) 554 | { 555 | writeCmd(ST7735_PTLAR); 556 | writeData(sr >> 8); writeData(sr); 557 | writeData(er >> 8); writeData(er); 558 | } 559 | 560 | // ---------------------------------------------------------- 561 | // doesn't work 562 | void Arduino_ST7735::setBrightness(uint8_t br) 563 | { 564 | } 565 | 566 | // ---------------------------------------------------------- 567 | // 0 - off 568 | // 1 - idle 569 | // 2 - normal 570 | // 4 - display off 571 | void Arduino_ST7735::powerSave(uint8_t mode) 572 | { 573 | if(mode==0) { 574 | writeCmd(ST7735_POWSAVE); 575 | writeData(0xec|3); 576 | writeCmd(ST7735_DLPOFFSAVE); 577 | writeData(0xff); 578 | return; 579 | } 580 | int is = (mode&1) ? 0 : 1; 581 | int ns = (mode&2) ? 0 : 2; 582 | writeCmd(ST7735_POWSAVE); 583 | writeData(0xec|ns|is); 584 | if(mode&4) { 585 | writeCmd(ST7735_DLPOFFSAVE); 586 | writeData(0xfe); 587 | } 588 | } 589 | 590 | // ------------------------------------------------ 591 | // Input a value 0 to 511 (85*6) to get a color value. 592 | // The colours are a transition R - Y - G - C - B - M - R. 593 | void Arduino_ST7735::rgbWheel(int idx, uint8_t *_r, uint8_t *_g, uint8_t *_b) 594 | { 595 | idx &= 0x1ff; 596 | if(idx < 85) { // R->Y 597 | *_r = 255; *_g = idx * 3; *_b = 0; 598 | return; 599 | } else if(idx < 85*2) { // Y->G 600 | idx -= 85*1; 601 | *_r = 255 - idx * 3; *_g = 255; *_b = 0; 602 | return; 603 | } else if(idx < 85*3) { // G->C 604 | idx -= 85*2; 605 | *_r = 0; *_g = 255; *_b = idx * 3; 606 | return; 607 | } else if(idx < 85*4) { // C->B 608 | idx -= 85*3; 609 | *_r = 0; *_g = 255 - idx * 3; *_b = 255; 610 | return; 611 | } else if(idx < 85*5) { // B->M 612 | idx -= 85*4; 613 | *_r = idx * 3; *_g = 0; *_b = 255; 614 | return; 615 | } else { // M->R 616 | idx -= 85*5; 617 | *_r = 255; *_g = 0; *_b = 255 - idx * 3; 618 | return; 619 | } 620 | } 621 | 622 | uint16_t Arduino_ST7735::rgbWheel(int idx) 623 | { 624 | uint8_t r,g,b; 625 | rgbWheel(idx, &r,&g,&b); 626 | return RGBto565(r,g,b); 627 | } 628 | 629 | // ------------------------------------------------ -------------------------------------------------------------------------------- /Arduino_ST7735_Fast.h: -------------------------------------------------------------------------------- 1 | // Fast ST7735 128x160 SPI display library 2 | // (c) 2019 by Pawel A. Hernik 3 | 4 | /* 5 | ST7735 pinout (header at the top, from left; better viewing angles): 6 | #1 LED -> 3.3V 7 | #2 SCK -> D13 8 | #3 SDA -> D11/MOSI 9 | #4 A0/DC -> D8 or any digital 10 | #5 RESET -> D9 or any digital 11 | #6 CS -> D10 or any digital 12 | #7 GND -> GND 13 | #8 VCC -> 3.3V 14 | */ 15 | 16 | #ifndef _ST7735_FAST_H_ 17 | #define _ST7735_FAST_H_ 18 | 19 | // ------------------------------ 20 | // remove "define COMPATIBILITY_MODE" for best performance on 16MHz AVR Arduinos 21 | // if defined - the library should work on all Arduino compatible boards 22 | //#define COMPATIBILITY_MODE 23 | 24 | // define for LCD boards where CS pin is internally connected to the ground 25 | //#define CS_ALWAYS_LOW 26 | // ------------------------------ 27 | 28 | #include "Arduino.h" 29 | #include "Print.h" 30 | #include 31 | #include 32 | 33 | #define ST7735_TFTWIDTH 128 34 | #define ST7735_TFTHEIGHT 160 35 | 36 | // Some register settings 37 | #define ST7735_MADCTL_BGR 0x08 38 | #define ST7735_MADCTL_MH 0x04 39 | 40 | #define ST7735_FRMCTR1 0xB1 41 | #define ST7735_FRMCTR2 0xB2 42 | #define ST7735_FRMCTR3 0xB3 43 | #define ST7735_INVCTR 0xB4 44 | #define ST7735_DISSET5 0xB6 45 | 46 | #define ST7735_PWCTR1 0xC0 47 | #define ST7735_PWCTR2 0xC1 48 | #define ST7735_PWCTR3 0xC2 49 | #define ST7735_PWCTR4 0xC3 50 | #define ST7735_PWCTR5 0xC4 51 | #define ST7735_VMCTR1 0xC5 52 | 53 | #define ST7735_PWCTR6 0xFC 54 | 55 | #define ST7735_GMCTRP1 0xE0 56 | #define ST7735_GMCTRN1 0xE1 57 | 58 | 59 | 60 | #define ST_CMD_DELAY 0x80 61 | 62 | #define ST7735_NOP 0x00 63 | #define ST7735_SWRESET 0x01 64 | 65 | #define ST7735_SLPIN 0x10 // sleep on 66 | #define ST7735_SLPOUT 0x11 // sleep off 67 | #define ST7735_PTLON 0x12 // partial on 68 | #define ST7735_NORON 0x13 // partial off 69 | #define ST7735_INVOFF 0x20 // invert off 70 | #define ST7735_INVON 0x21 // invert on 71 | #define ST7735_DISPOFF 0x28 // display off 72 | #define ST7735_DISPON 0x29 // display on 73 | #define ST7735_IDMOFF 0x38 // idle off 74 | #define ST7735_IDMON 0x39 // idle on 75 | 76 | #define ST7735_CASET 0x2A 77 | #define ST7735_RASET 0x2B 78 | #define ST7735_RAMWR 0x2C 79 | #define ST7735_RAMRD 0x2E 80 | 81 | #define ST7735_COLMOD 0x3A 82 | #define ST7735_MADCTL 0x36 83 | 84 | #define ST7735_PTLAR 0x30 // partial start/end 85 | #define ST7735_VSCRDEF 0x33 // SETSCROLLAREA 86 | #define ST7735_VSCRSADD 0x37 87 | 88 | #define ST7735_WRDISBV 0x51 89 | #define ST7735_WRCTRLD 0x53 90 | #define ST7735_WRCACE 0x55 91 | #define ST7735_WRCABCMB 0x5e 92 | 93 | #define ST7735_POWSAVE 0xbc 94 | #define ST7735_DLPOFFSAVE 0xbd 95 | 96 | // bits in MADCTL 97 | #define ST7735_MADCTL_MY 0x80 98 | #define ST7735_MADCTL_MX 0x40 99 | #define ST7735_MADCTL_MV 0x20 100 | #define ST7735_MADCTL_ML 0x10 101 | #define ST7735_MADCTL_RGB 0x00 102 | 103 | 104 | // Color definitions 105 | #define BLACK 0x0000 106 | #define BLUE 0x001F 107 | #define RED 0xF800 108 | #define GREEN 0x07E0 109 | #define CYAN 0x07FF 110 | #define MAGENTA 0xF81F 111 | #define YELLOW 0xFFE0 112 | #define WHITE 0xFFFF 113 | 114 | #define RGBto565(r,g,b) ((((r) & 0xF8) << 8) | (((g) & 0xFC) << 3) | ((b) >> 3)) 115 | 116 | class Arduino_ST7735 : public Adafruit_GFX { 117 | 118 | public: 119 | Arduino_ST7735(int8_t DC, int8_t RST, int8_t CS = -1); 120 | 121 | void init(); 122 | void begin() { init(); } 123 | void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); 124 | void pushColor(uint16_t color); 125 | void fillScreen(uint16_t color=BLACK); 126 | void clearScreen() { fillScreen(BLACK); } 127 | void drawPixel(int16_t x, int16_t y, uint16_t color); 128 | void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); 129 | void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); 130 | void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); 131 | void drawImage(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t *img); 132 | void drawImageF(int16_t x, int16_t y, int16_t w, int16_t h, const uint16_t *img16); 133 | void drawImageF(int16_t x, int16_t y, const uint16_t *img16) { drawImageF(x,y,pgm_read_word(img16),pgm_read_word(img16+1),img16+3); } 134 | void setRotation(uint8_t r); 135 | void invertDisplay(boolean mode); 136 | void partialDisplay(boolean mode); 137 | void sleepDisplay(boolean mode); 138 | void enableDisplay(boolean mode); 139 | void idleDisplay(boolean mode); 140 | void resetDisplay(); 141 | void setScrollArea(uint16_t tfa, uint16_t bfa); 142 | void setScroll(uint16_t vsp); 143 | void setPartArea(uint16_t sr, uint16_t er); 144 | void setBrightness(uint8_t br); 145 | void powerSave(uint8_t mode); 146 | 147 | uint16_t Color565(uint8_t r, uint8_t g, uint8_t b); 148 | uint16_t color565(uint8_t r, uint8_t g, uint8_t b) { return Color565(r, g, b); } 149 | void rgbWheel(int idx, uint8_t *_r, uint8_t *_g, uint8_t *_b); 150 | uint16_t rgbWheel(int idx); 151 | 152 | protected: 153 | uint8_t _colstart, _rowstart, _xstart, _ystart; 154 | 155 | void displayInit(const uint8_t *addr); 156 | void writeSPI(uint8_t); 157 | void writeCmd(uint8_t c); 158 | void writeData(uint8_t d); 159 | 160 | private: 161 | int8_t csPin, dcPin, rstPin; 162 | uint8_t csMask, dcMask; 163 | volatile uint8_t *csPort, *dcPort; 164 | 165 | }; 166 | 167 | #endif 168 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arduino_ST7735_Fast 2 | Fast ST7735 1.8" 128x160 LCD SPI display library 3 | 4 | YouTube videos: 5 | 6 | https://youtu.be/V1KBm99Qagw 7 | 8 | https://youtu.be/KwtkfmglT-c 9 | 10 | Significantly optimized for 16MHz AVR Arduino boards (2-6x faster than other available libraries) 11 | 12 | Achieved 6.9Mbps SPI transfer rate (at DIV2/16MHz clock) 13 | 14 | ## Configuration 15 | 16 | Use "#define COMPATIBILITY_MODE" - then the library should work on all Arduino compatible boards 17 | Remove above for the best performance on 16MHz AVR 18 | 19 | Use "#define CS_ALWAYS_LOW" for LCD boards where CS pin is internally connected to the ground, it gives better performance 20 | 21 | Tested with Arduino IDE 1.6.5 and Adafruit_GFX 1.5.6 22 | 23 | ## Extra Features 24 | - invertDisplay() 25 | - sleepDisplay() 26 | - enableDisplay() 27 | - idleDisplay() - saves power by limiting colors to 3 bit mode (8 colors) 28 | - resetDisplay() - software reset 29 | - partialDisplay() and setPartArea() - limiting display area for power saving 30 | - setScrollArea() and setScroll() - smooth vertical scrolling 31 | - fast drawImage() from RAM 32 | - fast drawImage() from flash (PROGMEM) 33 | 34 | ## Connections (header at the top): 35 | 36 | |LCD pin|LCD pin name|Arduino| 37 | |--|--|--| 38 | |#01| LED| 3.3V| 39 | |#02| SCK |D13/SCK| 40 | |#03| SCA |D11/MOSI| 41 | |#04| A0/DC|D8 or any digital 42 | |#05| RESET|D9 or any digital| 43 | |#06| CS|D10 or any digital| 44 | |#07| GND | GND| 45 | |#08| VCC | 3.3V| 46 | 47 | 48 | If you find it useful and want to buy me a coffee or a beer: 49 | 50 | https://www.paypal.me/cbm80amiga 51 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | This is fast SPI library for ST7735 128x160 SPI display. 2 | 3 | Optimized for the best performance for 16MHz AVR Arduino boards. 4 | Requires Adafruit_GFX library for Arduino. 5 | -------------------------------------------------------------------------------- /examples/ST7735_AdafruitBenchmark/ST7735_AdafruitBenchmark.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library benchmark 2 | // (c) 2019 Pawel A. Hernik 3 | 4 | /* 5 | ST7735 128x160 1.8" LCD pinout (header at the top, from left): 6 | #1 LED -> 3.3V 7 | #2 SCK -> SCL/D13/PA5 8 | #3 SDA -> MOSI/D11/PA7 9 | #4 A0/DC -> D8/PA1 or any digital 10 | #5 RESET -> D9/PA0 or any digital 11 | #6 CS -> D10/PA2 or any digital 12 | #7 GND -> GND 13 | #8 VCC -> 3.3V 14 | */ 15 | 16 | #define SCR_WD 128 17 | #define SCR_HT 160 18 | #include 19 | #include 20 | 21 | #if (__STM32F1__) // bluepill 22 | #define TFT_CS PA2 23 | #define TFT_DC PA1 24 | #define TFT_RST PA0 25 | //#include 26 | #else 27 | #define TFT_CS 10 28 | #define TFT_DC 8 29 | #define TFT_RST 9 30 | #include 31 | #endif 32 | 33 | Arduino_ST7735 tft = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 34 | 35 | // Color definitions 36 | #define BLACK 0x0000 37 | #define BLUE 0x001F 38 | #define RED 0xF800 39 | #define GREEN 0x07E0 40 | #define CYAN 0x07FF 41 | #define MAGENTA 0xF81F 42 | #define YELLOW 0xFFE0 43 | #define WHITE 0xFFFF 44 | #define RGBto565(r,g,b) ((((r) & 0xF8) << 8) | (((g) & 0xFC) << 3) | ((b) >> 3)) 45 | 46 | 47 | // ------------------------------------------------ 48 | unsigned long FillScreenTest() 49 | { 50 | unsigned long start = millis(); 51 | for(int i=0;i<5;i++) { 52 | tft.fillScreen(RED); 53 | tft.fillScreen(GREEN); 54 | tft.fillScreen(BLUE); 55 | tft.fillScreen(YELLOW); 56 | } 57 | return millis()-start; 58 | } 59 | 60 | // ------------------------------------------------ 61 | unsigned long ClearScreenTest() 62 | { 63 | unsigned long start = millis(); 64 | for(int i=0;i<5*4;i++) 65 | tft.fillScreen(BLACK); 66 | return millis()-start; 67 | } 68 | // ------------------------------------------------ 69 | const uint16_t imgF[] PROGMEM = {0xF800,0xF840,0xF8A0,0xF900,0xF960,0xF9C0,0xFA20,0xFA80,0xFAE0,0xFB40,0xFBA0,0xFC00,0xFC60,0xFCC0,0xFD20,0xFD80,0xFDE0,0xFE40,0xFEA0,0xFF00,0xFF60,0xFFC0,0xFFE0,0xEFE0,0xE7E0,0xD7E0,0xCFE0,0xBFE0,0xB7E0,0xA7E0,0x9FE0,0x8FE0,0x87E0,0x77E0,0x6FE0,0x5FE0,0x57E0,0x47E0,0x3FE0,0x2FE0,0x27E0,0x17E0,0xFE0,0x7E0,0x7E1,0x7E3,0x7E4,0x7E6,0x7E7,0x7E9,0x7EA,0x7EC,0x7ED,0x7EF,0x7F0,0x7F2,0x7F3,0x7F5,0x7F6,0x7F8,0x7F9,0x7FB,0x7FC,0x7FE,0x7FF,0x79F,0x73F,0x6DF,0x67F,0x61F,0x5BF,0x55F,0x4FF,0x49F,0x43F,0x3DF,0x37F,0x31F,0x2BF,0x25F,0x1FF,0x19F,0x13F,0xDF,0x7F,0x1F,0x81F,0x101F,0x201F,0x281F,0x381F,0x401F,0x501F,0x581F,0x681F,0x701F,0x801F,0x881F,0x981F,0xA01F,0xB01F,0xB81F,0xC81F,0xD01F,0xE01F,0xE81F,0xF81F,0xF81F,0xF81D,0xF81C,0xF81A,0xF819,0xF817,0xF816,0xF814,0xF813,0xF811,0xF810,0xF80E,0xF80D,0xF80B,0xF80A,0xF808,0xF807,0xF805,0xF804,0xF802,0xF801, 70 | 0xF800,0xF840,0xF8A0,0xF900,0xF960,0xF9C0,0xFA20,0xFA80,0xFAE0,0xFB40,0xFBA0,0xFC00,0xFC60,0xFCC0,0xFD20,0xFD80,0xFDE0,0xFE40,0xFEA0,0xFF00,0xFF60,0xFFC0,0xFFE0,0xEFE0,0xE7E0,0xD7E0,0xCFE0,0xBFE0,0xB7E0,0xA7E0,0x9FE0,0x8FE0,0x87E0,0x77E0,0x6FE0,0x5FE0,0x57E0,0x47E0,0x3FE0,0x2FE0,0x27E0,0x17E0,0xFE0,0x7E0,0x7E1,0x7E3,0x7E4,0x7E6,0x7E7,0x7E9,0x7EA,0x7EC,0x7ED,0x7EF,0x7F0,0x7F2,0x7F3,0x7F5,0x7F6,0x7F8,0x7F9,0x7FB,0x7FC,0x7FE,0x7FF,0x79F,0x73F,0x6DF,0x67F,0x61F,0x5BF,0x55F,0x4FF,0x49F,0x43F,0x3DF,0x37F,0x31F,0x2BF,0x25F,0x1FF,0x19F,0x13F,0xDF,0x7F,0x1F,0x81F,0x101F,0x201F,0x281F,0x381F,0x401F,0x501F,0x581F,0x681F,0x701F,0x801F,0x881F,0x981F,0xA01F,0xB01F,0xB81F,0xC81F,0xD01F,0xE01F,0xE81F,0xF81F,0xF81F,0xF81D,0xF81C,0xF81A,0xF819,0xF817,0xF816,0xF814,0xF813,0xF811,0xF810,0xF80E,0xF80D,0xF80B,0xF80A,0xF808,0xF807,0xF805,0xF804,0xF802,0xF801}; 71 | uint16_t img[SCR_WD]; 72 | unsigned long DrawImageTest() 73 | { 74 | for(int i=0;i0; i-=6) { 424 | i2 = i / 2; 425 | start = micros(); 426 | tft.fillRect(cx-i2, cy-i2, i, i, color1); 427 | t += micros() - start; 428 | // Outlines are not included in timing results 429 | tft.drawRect(cx-i2, cy-i2, i, i, color2); 430 | } 431 | 432 | return t; 433 | } 434 | 435 | // ------------------------------------------------ 436 | unsigned long testFilledCircles(uint8_t radius, uint16_t color) { 437 | unsigned long start; 438 | int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2; 439 | 440 | tft.fillScreen(BLACK); 441 | start = micros(); 442 | for(x=radius; x10; i-=5) { 499 | start = micros(); 500 | tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, 501 | RGBto565(0, i, i)); 502 | t += micros() - start; 503 | tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, 504 | RGBto565(i, i, 0)); 505 | } 506 | 507 | return t; 508 | } 509 | 510 | // ------------------------------------------------ 511 | unsigned long testRoundRects() { 512 | unsigned long start; 513 | int w, i, i2, 514 | cx = tft.width() / 2 - 1, 515 | cy = tft.height() / 2 - 1; 516 | 517 | tft.fillScreen(BLACK); 518 | w = min(tft.width(), tft.height()); 519 | start = micros(); 520 | for(i=0; i20; i-=6) { 538 | i2 = i / 2; 539 | tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, RGBto565(0, i, 0)); 540 | } 541 | 542 | return micros() - start; 543 | } 544 | // ------------------------------------------------ 545 | 546 | -------------------------------------------------------------------------------- /examples/ST7735_AmigaBall/ST7735_AmigaBall.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library example 2 | // Amiga Boing Ball Demo 3 | // (c) 2019 Pawel A. Hernik 4 | // YT video: https://youtu.be/KwtkfmglT-c 5 | 6 | /* 7 | ST7735 128x160 LCD pinout (header at the top for better viewwing angles, from left): 8 | #1 LED -> 3.3V 9 | #2 SCK -> SCL/D13/PA5 10 | #3 SDA -> MOSI/D11/PA7 11 | #4 A0/DC -> D8/PA1 or any digital 12 | #5 RESET -> D9/PA0 or any digital 13 | #6 CS -> D10/PA2 or any digital 14 | #7 GND -> GND 15 | #8 VCC -> 3.3V 16 | */ 17 | 18 | #define SCR_WD 128 19 | #define SCR_HT 160 20 | #include 21 | #include 22 | 23 | #if (__STM32F1__) // bluepill 24 | #define TFT_CS PA2 25 | #define TFT_DC PA1 26 | #define TFT_RST PA0 27 | //#include 28 | #else 29 | #define TFT_CS 10 30 | #define TFT_DC 8 31 | #define TFT_RST 9 32 | #include 33 | #endif 34 | 35 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 36 | 37 | #include "ball.h" 38 | 39 | uint16_t palette[16]; 40 | uint16_t line[SCR_WD]; 41 | uint16_t bgCol = RGBto565(160,160,160); 42 | uint16_t bgColS = RGBto565(90,90,90); 43 | uint16_t lineCol = RGBto565(150,40,150); 44 | uint16_t lineColS = RGBto565(80,10,80); 45 | 46 | #define LINE_YS 10 47 | #define LINE_XS1 19 48 | #define LINE_XS2 2 49 | 50 | #define BALL_WD 64 51 | #define BALL_HT 64 52 | #define BALL_SWD 128 53 | #define BALL_SHT 131 54 | 55 | #define SHADOW 20 56 | //#define SHADOW 0 57 | 58 | // AVR stats: 59 | // with shadow - 42-43ms/24fps 60 | // without shadow - 37-38ms/27fps 61 | // without background - 31-32ms/32fps 62 | // SPI transfer only - 22-23ms/45fps (128x64x16bit) 63 | // STM32 stats: TBD 64 | 65 | void drawBall(int x, int y) 66 | { 67 | int i,j,ii; 68 | for(j=0;jLINE_YS) for(i=0;i<10;i++) line[LINE_XS1+i*10]=lineCol; 78 | } 79 | for(i=BALL_WD-2;i>=0;i-=2) { 80 | v = pgm_read_byte(--img); 81 | if(v>>4) { 82 | line[x+i+0] = palette[v>>4]; 83 | #if SHADOW>0 84 | ii=x+i+0+SHADOW; 85 | if(ii0 91 | ii=x+i+1+SHADOW; 92 | if(ii=BALL_SWD-BALL_WD) { x=BALL_SWD-BALL_WD; xd=-xd; animd=-animd; } 143 | if(y<0) { y=0; yd=-yd; } 144 | if(y>=BALL_SHT-BALL_HT) { y=BALL_SHT-BALL_HT; yd=-yd; } 145 | //delay(20); 146 | ms=millis()-ms; 147 | //Serial.println(ms); 148 | } 149 | 150 | -------------------------------------------------------------------------------- /examples/ST7735_AmigaBall/ball.h: -------------------------------------------------------------------------------- 1 | // Generated by bmp2src by Pawel A. Hernik 2 | // Generated from: ball.bmp 3 | // Dimensions : 64x64x4 (16 colors) 4 | // Size : 2048 [0x0800] bytes 5 | 6 | 7 | const unsigned char ball[2048+16*2+6] PROGMEM = { 8 | 64,0,64,0,4,0, // width,height,bits 9 | 0x10,0x84, // c000->130,130,130 10 | 0x00,0xf8, // c001->255, 0, 0 11 | 0x00,0xf8, // c002->255, 0, 0 12 | 0x00,0xf8, // c003->255, 0, 0 13 | 0x00,0xf8, // c004->255, 0, 0 14 | 0x00,0xf8, // c005->255, 0, 0 15 | 0x00,0xf8, // c006->255, 0, 0 16 | 0x00,0xf8, // c007->255, 0, 0 17 | 0xff,0xff, // c008->255,255,255 18 | 0xff,0xff, // c009->255,255,255 19 | 0xff,0xff, // c010->255,255,255 20 | 0xff,0xff, // c011->255,255,255 21 | 0xff,0xff, // c012->255,255,255 22 | 0xff,0xff, // c013->255,255,255 23 | 0xff,0xff, // c014->255,255,255 24 | 0xff,0xff, // c015->255,255,255 25 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 26 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 27 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 28 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 29 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x1e,0xed,0xdc, 30 | 0xcc,0xbb,0xbc,0x57,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 31 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x87,0x76,0xcc,0xbb,0xaa, 32 | 0x99,0x88,0x87,0x7e,0xe1,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 33 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x87,0x65,0x54,0x43,0xa9,0x88, 34 | 0x87,0x76,0x65,0x55,0x4b,0xaa,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 35 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x87,0x65,0x54,0x43,0x32,0x11,0x77, 36 | 0x66,0x55,0x54,0x43,0x21,0x87,0x65,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 37 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x87,0x66,0x54,0x43,0x32,0x11,0xee,0xd6, 38 | 0x55,0x54,0x43,0x32,0x1e,0xed,0x55,0x42,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 39 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x76,0x55,0x43,0x32,0x11,0x1e,0xed,0xdc, 40 | 0xc4,0x43,0x32,0x11,0xee,0xdc,0xcc,0x32,0xda,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 41 | 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0xed,0x65,0x44,0x33,0x21,0x1e,0xed,0xdc,0xcc, 42 | 0xbb,0xa3,0x21,0x1e,0xed,0xcc,0xcb,0xa2,0xec,0x93,0x00,0x00,0x00,0x00,0x00,0x00, 43 | 0x00,0x00,0x00,0x00,0x00,0x03,0x1e,0xdd,0xc4,0x43,0x22,0x11,0xee,0xdd,0xcc,0xbb, 44 | 0xaa,0xa9,0x11,0xee,0xdd,0xcc,0xba,0x98,0x75,0x48,0x30,0x00,0x00,0x00,0x00,0x00, 45 | 0x00,0x00,0x00,0x00,0x00,0x31,0xed,0xcc,0xbb,0xa2,0x21,0x1e,0xed,0xdc,0xcb,0xba, 46 | 0xaa,0x98,0x87,0x7d,0xdc,0xcc,0xba,0x98,0x76,0x43,0xe2,0x00,0x00,0x00,0x00,0x00, 47 | 0x00,0x00,0x00,0x00,0x04,0x1e,0xdc,0xcb,0xaa,0x98,0x1e,0xee,0xdd,0xcc,0xbb,0xaa, 48 | 0xa9,0x88,0x77,0x66,0xcc,0xcb,0xaa,0x98,0x76,0x53,0x1d,0x80,0x00,0x00,0x00,0x00, 49 | 0x00,0x00,0x00,0x00,0x42,0xed,0xcc,0xba,0xa9,0x88,0x77,0xed,0xdc,0xcb,0xba,0xaa, 50 | 0x98,0x87,0x76,0x66,0x5c,0xbb,0xa9,0x98,0x76,0x54,0x2e,0xb6,0x00,0x00,0x00,0x00, 51 | 0x00,0x00,0x00,0x00,0x21,0xdd,0xcb,0xba,0x99,0x88,0x77,0x66,0xcc,0xbb,0xaa,0xa9, 52 | 0x88,0x87,0x76,0x65,0x55,0x4a,0xa9,0x98,0x76,0x54,0x31,0xda,0x00,0x00,0x00,0x00, 53 | 0x00,0x00,0x00,0x03,0x1e,0xdc,0xbb,0xa9,0x98,0x87,0x76,0x65,0x54,0xbb,0xaa,0x98, 54 | 0x88,0x77,0x66,0x55,0x54,0x43,0x32,0x88,0x76,0x54,0x32,0xec,0x90,0x00,0x00,0x00, 55 | 0x00,0x00,0x00,0x31,0xed,0xcb,0xba,0xa9,0x88,0x77,0x66,0x55,0x44,0x4a,0xa9,0x98, 56 | 0x87,0x76,0x66,0x55,0x54,0x33,0x22,0x17,0x66,0x54,0x32,0x1d,0xa7,0x00,0x00,0x00, 57 | 0x00,0x00,0x00,0x2e,0xdc,0xcb,0xaa,0x98,0x87,0x76,0x65,0x55,0x44,0x33,0x29,0x88, 58 | 0x77,0x76,0x65,0x55,0x44,0x33,0x21,0x1e,0xd6,0x54,0x32,0x1d,0xb9,0x00,0x00,0x00, 59 | 0x00,0x00,0x0a,0x87,0xdc,0xbb,0xa9,0x88,0x77,0x66,0x65,0x54,0x43,0x33,0x21,0x18, 60 | 0x77,0x66,0x55,0x54,0x43,0x32,0x21,0x1e,0xdc,0xc4,0x32,0x1d,0xca,0x70,0x00,0x00, 61 | 0x00,0x00,0xc9,0x76,0x54,0xba,0xa9,0x88,0x77,0x66,0x55,0x44,0x33,0x32,0x11,0x1e, 62 | 0x76,0x66,0x55,0x54,0x43,0x32,0x21,0x1e,0xdc,0xcb,0xa2,0x1e,0xcb,0x94,0x00,0x00, 63 | 0x00,0x00,0xa8,0x76,0x54,0x3a,0x98,0x87,0x76,0x65,0x54,0x44,0x33,0x22,0x11,0xee, 64 | 0xed,0xd5,0x55,0x44,0x33,0x22,0x11,0xed,0xdc,0xcb,0xa9,0x87,0xdb,0xa6,0x00,0x00, 65 | 0x00,0x00,0x97,0x65,0x44,0x32,0x98,0x77,0x66,0x55,0x54,0x43,0x32,0x21,0x11,0xee, 66 | 0xdd,0xcc,0x55,0x44,0x33,0x22,0x11,0xed,0xdc,0xbb,0xa9,0x87,0x6c,0xa8,0x00,0x00, 67 | 0x00,0x0a,0x87,0x65,0x43,0x32,0x11,0xe7,0x66,0x55,0x44,0x33,0x32,0x11,0x1e,0xed, 68 | 0xdd,0xcc,0xcb,0x43,0x32,0x22,0x11,0xed,0xdc,0xbb,0xa9,0x87,0x65,0x42,0x50,0x00, 69 | 0x00,0x0a,0x86,0x55,0x43,0x21,0x1e,0xed,0x65,0x55,0x44,0x33,0x22,0x11,0xee,0xed, 70 | 0xdc,0xcc,0xbb,0xba,0x32,0x21,0x1e,0xdd,0xcc,0xbb,0xa9,0x87,0x65,0x42,0xe0,0x00, 71 | 0x00,0x09,0x76,0x54,0x33,0x21,0x1e,0xed,0xdc,0x54,0x43,0x33,0x21,0x11,0xee,0xdd, 72 | 0xdc,0xcc,0xbb,0xaa,0x99,0x21,0x1e,0xdd,0xcc,0xba,0xa9,0x87,0x65,0x43,0x10,0x00, 73 | 0x00,0xb8,0x76,0x54,0x32,0x21,0xee,0xdd,0xcc,0xb4,0x43,0x32,0x21,0x1e,0xee,0xdd, 74 | 0xcc,0xcb,0xbb,0xaa,0x99,0x88,0xee,0xdd,0xcc,0xba,0xa9,0x87,0x65,0x43,0x1c,0x00, 75 | 0x00,0xa8,0x65,0x44,0x32,0x11,0xee,0xdd,0xcc,0xbb,0xa3,0x22,0x11,0x1e,0xed,0xdd, 76 | 0xcc,0xcb,0xba,0xa9,0x99,0x88,0x7d,0xdc,0xcb,0xba,0xa9,0x87,0x65,0x43,0x1d,0x00, 77 | 0x00,0x97,0x65,0x43,0x32,0x1e,0xed,0xdc,0xcb,0xbb,0xaa,0x98,0x11,0xee,0xdd,0xdc, 78 | 0xcc,0xbb,0xaa,0xa9,0x98,0x88,0x76,0x65,0xcb,0xba,0x99,0x87,0x65,0x43,0x2d,0x00, 79 | 0x00,0x97,0x65,0x43,0x21,0x1e,0xed,0xdc,0xcb,0xba,0xa9,0x98,0x87,0xee,0xdd,0xcc, 80 | 0xcc,0xbb,0xaa,0x99,0x98,0x87,0x76,0x65,0x5b,0xba,0x99,0x87,0x65,0x43,0x2d,0x00, 81 | 0x00,0x17,0x65,0x43,0x21,0x1e,0xdd,0xcc,0xbb,0xba,0xa9,0x88,0x87,0x76,0xdd,0xcc, 82 | 0xcb,0xba,0xaa,0x99,0x88,0x87,0x66,0x55,0x44,0x3a,0x99,0x87,0x65,0x43,0x2e,0x00, 83 | 0x00,0x1e,0x54,0x43,0x21,0xee,0xdd,0xcc,0xbb,0xaa,0x99,0x88,0x77,0x76,0xdc,0xcc, 84 | 0xcb,0xba,0xa9,0x99,0x88,0x77,0x66,0x55,0x44,0x33,0x28,0x87,0x65,0x43,0x2e,0x00, 85 | 0x00,0x1d,0xcb,0x33,0x21,0xee,0xdd,0xcc,0xbb,0xaa,0x98,0x88,0x77,0x66,0x65,0x5c, 86 | 0xbb,0xaa,0xa9,0x98,0x88,0x76,0x66,0x55,0x44,0x32,0x21,0x17,0x65,0x43,0x2e,0x00, 87 | 0x00,0x1d,0xcb,0xa9,0x11,0xed,0xdc,0xcb,0xba,0xa9,0x98,0x87,0x77,0x66,0x55,0x54, 88 | 0xbb,0xaa,0x99,0x98,0x87,0x76,0x65,0x54,0x43,0x32,0x21,0xed,0xd5,0x43,0x2e,0x00, 89 | 0x00,0x1d,0xcb,0xa9,0x81,0xed,0xdc,0xcb,0xba,0xa9,0x88,0x87,0x76,0x66,0x55,0x54, 90 | 0x43,0xaa,0x99,0x88,0x87,0x66,0x65,0x54,0x43,0x32,0x21,0xed,0xdc,0xb3,0x2e,0x00, 91 | 0x00,0x1d,0xcb,0xa9,0x87,0x76,0xdc,0xbb,0xaa,0xa9,0x88,0x77,0x76,0x65,0x55,0x44, 92 | 0x43,0x32,0x99,0x88,0x77,0x66,0x55,0x44,0x33,0x22,0x11,0xed,0xcc,0xba,0x9e,0x00, 93 | 0x00,0x1d,0xcb,0xa9,0x87,0x76,0x55,0xbb,0xaa,0x99,0x88,0x77,0x66,0x65,0x55,0x44, 94 | 0x33,0x32,0x21,0x88,0x76,0x66,0x55,0x44,0x33,0x22,0x11,0xed,0xcb,0xba,0x86,0x00, 95 | 0x00,0x1d,0xcb,0xa9,0x87,0x66,0x55,0x4b,0xaa,0x98,0x87,0x77,0x66,0x55,0x54,0x44, 96 | 0x33,0x22,0x21,0x1e,0x76,0x65,0x54,0x44,0x33,0x22,0x1e,0xdd,0xcb,0xa9,0x86,0x00, 97 | 0x00,0x1d,0xcb,0xa9,0x87,0x66,0x54,0x43,0x39,0x98,0x87,0x76,0x66,0x55,0x54,0x43, 98 | 0x33,0x22,0x11,0x1e,0xdd,0x65,0x54,0x43,0x32,0x21,0x1e,0xdd,0xcb,0xa9,0x86,0x00, 99 | 0x00,0x2d,0xcb,0xa8,0x87,0x66,0x54,0x43,0x32,0x18,0x77,0x76,0x65,0x55,0x44,0x33, 100 | 0x32,0x22,0x11,0xee,0xdd,0xcc,0x44,0x43,0x32,0x21,0x1e,0xdc,0xcb,0xa9,0x86,0x00, 101 | 0x00,0x2e,0xcb,0xa8,0x87,0x65,0x54,0x43,0x32,0x11,0x77,0x66,0x65,0x55,0x44,0x33, 102 | 0x22,0x21,0x11,0xed,0xdd,0xcc,0xb4,0x33,0x22,0x11,0xed,0xdc,0xbb,0xa9,0x75,0x00, 103 | 0x00,0x3e,0xcb,0xa8,0x87,0x65,0x54,0x33,0x22,0x11,0xee,0x66,0x55,0x54,0x43,0x33, 104 | 0x22,0x11,0x1e,0xed,0xdc,0xcb,0xbb,0xa3,0x22,0x11,0xed,0xcc,0xba,0x98,0x74,0x00, 105 | 0x00,0x0e,0xcb,0xa8,0x87,0x65,0x54,0x33,0x21,0x1e,0xed,0xdd,0xc5,0x54,0x43,0x32, 106 | 0x22,0x11,0xee,0xdd,0xcc,0xcb,0xba,0xa9,0x91,0x1e,0xdd,0xcc,0xba,0x98,0x60,0x00, 107 | 0x00,0x08,0x6b,0xa9,0x87,0x65,0x44,0x33,0x21,0x1e,0xed,0xdc,0xcc,0x44,0x33,0x32, 108 | 0x21,0x11,0xed,0xdd,0xcc,0xbb,0xba,0xa9,0x98,0x8e,0xdd,0xcb,0xaa,0x98,0x60,0x00, 109 | 0x00,0x0a,0x64,0x39,0x87,0x65,0x44,0x32,0x21,0xee,0xdd,0xdc,0xcc,0xbb,0x33,0x22, 110 | 0x21,0x1e,0xed,0xdc,0xcc,0xbb,0xaa,0x99,0x88,0x76,0x6c,0xcb,0xa9,0x87,0x50,0x00, 111 | 0x00,0x00,0x75,0x32,0x87,0x65,0x44,0x32,0x11,0xee,0xdd,0xcc,0xcb,0xba,0xa2,0x22, 112 | 0x11,0xee,0xdd,0xcc,0xcb,0xba,0xaa,0x99,0x88,0x76,0x65,0x4b,0xa9,0x86,0x00,0x00, 113 | 0x00,0x00,0x85,0x42,0x1e,0x65,0x43,0x32,0x11,0xee,0xdd,0xcc,0xcb,0xba,0xa9,0x91, 114 | 0x11,0xed,0xdd,0xcc,0xbb,0xba,0xa9,0x98,0x87,0x66,0x55,0x43,0x98,0x75,0x00,0x00, 115 | 0x00,0x00,0xc6,0x43,0x1e,0xdc,0xb3,0x32,0x1e,0xed,0xdc,0xcc,0xbb,0xaa,0x99,0x98, 116 | 0x8e,0xed,0xdc,0xcc,0xbb,0xaa,0x99,0x88,0x77,0x65,0x54,0x33,0x21,0x63,0x00,0x00, 117 | 0x00,0x00,0x08,0x53,0x1e,0xdc,0xba,0x32,0x1e,0xed,0xdc,0xcc,0xba,0xaa,0x99,0x88, 118 | 0x77,0x66,0xcc,0xcb,0xba,0xa9,0x99,0x88,0x76,0x65,0x44,0x32,0x1e,0xc0,0x00,0x00, 119 | 0x00,0x00,0x00,0x64,0x2e,0xdc,0xba,0x98,0x1e,0xdd,0xcc,0xcb,0xba,0xa9,0x98,0x88, 120 | 0x76,0x66,0x5c,0xbb,0xaa,0xa9,0x98,0x87,0x66,0x55,0x43,0x32,0x1d,0x00,0x00,0x00, 121 | 0x00,0x00,0x00,0x85,0x21,0xdc,0xba,0x98,0x87,0xdd,0xcc,0xcb,0xaa,0x99,0x98,0x87, 122 | 0x76,0x65,0x54,0x4b,0xaa,0x99,0x88,0x77,0x65,0x54,0x43,0x21,0xec,0x00,0x00,0x00, 123 | 0x00,0x00,0x00,0x06,0x31,0xdc,0xba,0x98,0x77,0x65,0xcc,0xbb,0xaa,0x99,0x88,0x77, 124 | 0x66,0x55,0x44,0x43,0x39,0x98,0x87,0x76,0x65,0x44,0x32,0x1e,0xc0,0x00,0x00,0x00, 125 | 0x00,0x00,0x00,0x00,0x52,0xec,0xba,0x98,0x77,0x65,0x55,0xba,0xa9,0x98,0x87,0x76, 126 | 0x65,0x55,0x44,0x33,0x22,0x88,0x77,0x66,0x54,0x43,0x21,0x1d,0x00,0x00,0x00,0x00, 127 | 0x00,0x00,0x00,0x00,0x14,0x1d,0xba,0x98,0x76,0x65,0x54,0x43,0x99,0x98,0x87,0x66, 128 | 0x55,0x54,0x43,0x32,0x21,0x11,0x76,0x65,0x54,0x33,0x21,0xdb,0x00,0x00,0x00,0x00, 129 | 0x00,0x00,0x00,0x00,0x0e,0x9e,0xca,0x98,0x76,0x55,0x54,0x33,0x29,0x88,0x76,0x65, 130 | 0x55,0x44,0x33,0x22,0x11,0x1e,0xdd,0x55,0x43,0x32,0x1d,0xc0,0x00,0x00,0x00,0x00, 131 | 0x00,0x00,0x00,0x00,0x00,0xd8,0xcb,0x98,0x76,0x55,0x43,0x32,0x21,0x17,0x66,0x55, 132 | 0x54,0x43,0x32,0x21,0x1e,0xed,0xdc,0xcb,0x33,0x21,0xdc,0x00,0x00,0x00,0x00,0x00, 133 | 0x00,0x00,0x00,0x00,0x00,0x0c,0x74,0xa8,0x75,0x55,0x43,0x22,0x11,0xed,0xd5,0x55, 134 | 0x44,0x33,0x22,0x11,0xee,0xdd,0xcb,0xba,0x99,0x1d,0xc0,0x00,0x00,0x00,0x00,0x00, 135 | 0x00,0x00,0x00,0x00,0x00,0x00,0xd6,0x31,0xdc,0x54,0x33,0x21,0x1e,0xdd,0xcc,0xb4, 136 | 0x33,0x32,0x21,0x1e,0xdd,0xcc,0xbb,0xa9,0x98,0x64,0x00,0x00,0x00,0x00,0x00,0x00, 137 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x51,0xdc,0xc4,0x32,0x11,0xed,0xdc,0xcb,0xba, 138 | 0x32,0x21,0x11,0xed,0xdc,0xcb,0xaa,0x98,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 139 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xdc,0xba,0x21,0x1e,0xdc,0xcb,0xba,0xaa, 140 | 0x99,0x11,0xed,0xdc,0xcb,0xba,0x99,0x86,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 141 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0xa9,0x87,0xdd,0xcb,0xba,0xaa,0x99, 142 | 0x88,0x76,0xdc,0xcb,0xba,0xa9,0x87,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 143 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x55,0x44,0xaa,0xa9,0x98,0x87, 144 | 0x76,0x65,0x54,0xba,0x99,0x87,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 145 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0xe1,0x18,0x87,0x76,0x66, 146 | 0x55,0x44,0x33,0x21,0x86,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 147 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8a,0xa4,0x44,0x33, 148 | 0x32,0x22,0x1e,0xdc,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,0x0a, 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 | }; 154 | -------------------------------------------------------------------------------- /examples/ST7735_BigScroll/ST7735_BigScroll.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library example 2 | // (c) 2019 Pawel A. Hernik 3 | 4 | // requires RRE Font library: 5 | // https://github.com/cbm80amiga/RREFont 6 | 7 | /* 8 | ST7735 128x160 1.8" LCD pinout (header at the top, from left): 9 | #1 LED -> 3.3V 10 | #2 SCK -> SCL/D13/PA5 11 | #3 SDA -> MOSI/D11/PA7 12 | #4 A0/DC -> D8/PA1 or any digital 13 | #5 RESET -> D9/PA0 or any digital 14 | #6 CS -> D10/PA2 or any digital 15 | #7 GND -> GND 16 | #8 VCC -> 3.3V 17 | */ 18 | 19 | #define SCR_WD 128 20 | #define SCR_HT 160 21 | #include 22 | #include 23 | 24 | #if (__STM32F1__) // bluepill 25 | #define TFT_CS PA2 26 | #define TFT_DC PA1 27 | #define TFT_RST PA0 28 | //#include 29 | #else 30 | #define TFT_CS 10 31 | #define TFT_DC 8 32 | #define TFT_RST 9 33 | #include 34 | #endif 35 | 36 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 37 | 38 | #include "RREFont.h" 39 | #include "rre_times_98v.h" 40 | #include "rre_tahoma_65v.h" 41 | 42 | RRE_Font *rFont = &rre_Times98v; 43 | //RRE_Font *rFont = &rre_tahoma_65v; 44 | 45 | uint16_t bg = 0x0000, fg = 0xffff; 46 | int maxy = SCR_HT; 47 | int screenWd = SCR_WD, screenHt = SCR_HT; 48 | int spacing = 1; 49 | int sx = 1, sy = 1; 50 | int scrollStep = 2; 51 | int scrollDelay = 10; 52 | int cnt = 0; 53 | int ycnt = 0, yscr = 0; 54 | int offsY = 30; 55 | unsigned long ms; 56 | 57 | 58 | int scrollCharRRE(unsigned char c) 59 | { 60 | if(cfirstCh || c>rFont->lastCh) return 0; 61 | uint16_t recIdx = pgm_read_word(&(rFont->offs[c-rFont->firstCh])); 62 | uint16_t recNum = pgm_read_word(&(rFont->offs[c-rFont->firstCh+1]))-recIdx; 63 | int chWd = recNum>0 ? pgm_read_byte(rFont->rects + (recNum-1+recIdx)*3)+1 : 0; 64 | //Serial.println(String(char(c))+": "+chWd); 65 | spacing = (c==' ') ? rFont->wd/3 : 4; 66 | int idx = recIdx*3; 67 | for(int col = 0; col=maxy) yscr-=maxy; 71 | lcd.setScroll(yscr); 72 | ycnt=yscr+SCR_HT-1; 73 | if(ycnt>=maxy) ycnt-=maxy; 74 | //Serial.println(String("ycnt=")+ycnt); 75 | int scrHOffs = screenHt-1; 76 | int scrWOffs = screenWd-1; 77 | int lineY = scrHOffs-(screenHt-sx-ycnt); 78 | int wd; 79 | if(col>=chWd) { // draw empty column (spacing) 80 | wd = sy*rFont->ht; 81 | lcd.fillRect(scrWOffs-offsY-wd, lineY, wd, sx, bg); 82 | while(millis()-msrects+idx+0); 86 | int ybg = 0; 87 | //yf = pgm_read_byte(font_Rects+idx+1); Serial.print("yf="); Serial.println(yf); 88 | while(xf==col) { // draw all lines for current column 89 | yf = pgm_read_byte(rFont->rects+idx+1); 90 | hf = pgm_read_byte(rFont->rects+idx+2); 91 | if(yf>0) { // bg line top 92 | wd = (yf-ybg)*sy; 93 | lcd.fillRect(scrWOffs-(offsY+ybg*sy)-wd, lineY, wd, sx, bg); 94 | } 95 | ybg = yf+hf; 96 | wd = hf*sy; 97 | lcd.fillRect(scrWOffs-(offsY+yf*sy)-wd, lineY, wd, sx, fg); 98 | idx+=3; 99 | xf = pgm_read_byte(rFont->rects+idx+0); 100 | } 101 | //Serial.println("ys = "+String(ys)+" "+String(charHt)); 102 | 103 | if(ybght-1) { // last bg line 104 | wd = (rFont->ht-ybg)*sy; 105 | lcd.fillRect(scrWOffs-(offsY+ybg*sy)-wd, lineY, wd, sx, bg); 106 | } 107 | while(millis()-msht*sy)/2; 134 | //scrollString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-!?.: "); 135 | scrollString("This is an example of super-smooth scrolling with ordinary Arduino, ST7735 128x168 LCD library and large RRE font ... "); 136 | } 137 | 138 | -------------------------------------------------------------------------------- /examples/ST7735_Bitmap/ST7735_Bitmap.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library example 2 | // (c) 2019 Pawel A. Hernik 3 | 4 | /* 5 | ST7735 128x160 1.8" LCD pinout (header at the top, from left): 6 | #1 LED -> 3.3V 7 | #2 SCK -> SCL/D13/PA5 8 | #3 SDA -> MOSI/D11/PA7 9 | #4 A0/DC -> D8/PA1 or any digital 10 | #5 RESET -> D9/PA0 or any digital 11 | #6 CS -> D10/PA2 or any digital 12 | #7 GND -> GND 13 | #8 VCC -> 3.3V 14 | */ 15 | 16 | #define SCR_WD 128 17 | #define SCR_HT 160 18 | #include 19 | #include 20 | 21 | #if (__STM32F1__) // bluepill 22 | #define TFT_CS PA2 23 | #define TFT_DC PA1 24 | #define TFT_RST PA0 25 | //#include 26 | #else 27 | #define TFT_CS 10 28 | #define TFT_DC 8 29 | #define TFT_RST 9 30 | #include 31 | #endif 32 | 33 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 34 | 35 | #include "bitmap.h" 36 | 37 | #define BARWD 24 38 | uint16_t colorBar[BARWD]; 39 | 40 | void setup(void) 41 | { 42 | Serial.begin(9600); 43 | lcd.init(); 44 | lcd.fillScreen(BLACK); 45 | 46 | int i,j; 47 | for(j=0;j 3.3V 10 | #2 SCK -> SCL/D13/PA5 11 | #3 SDA -> MOSI/D11/PA7 12 | #4 A0/DC -> D8/PA1 or any digital 13 | #5 RESET -> D9/PA0 or any digital 14 | #6 CS -> D10/PA2 or any digital 15 | #7 GND -> GND 16 | #8 VCC -> 3.3V 17 | */ 18 | 19 | #define SCR_WD 128 20 | #define SCR_HT 160 21 | #include 22 | #include 23 | 24 | #if (__STM32F1__) // bluepill 25 | #define TFT_CS PA2 26 | #define TFT_DC PA1 27 | #define TFT_RST PA0 28 | //#include 29 | #else 30 | #define TFT_CS 10 31 | #define TFT_DC 8 32 | #define TFT_RST 9 33 | #include 34 | #endif 35 | 36 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 37 | 38 | #include "RREFont.h" 39 | #include "rre_fjg_8x16.h" 40 | 41 | RREFont font; 42 | 43 | // needed for RREFont library initialization, define your fillRect 44 | void customRect(int x, int y, int w, int h, int c) { return lcd.fillRect(x, y, w, h, c); } 45 | 46 | void setup() 47 | { 48 | Serial.begin(9600); 49 | lcd.init(); 50 | lcd.fillScreen(BLACK); 51 | font.init(customRect, SCR_WD, SCR_HT); // custom fillRect function and screen width and height values 52 | font.setFont(&rre_fjg_8x16); 53 | font.setScale(1); font.setSpacing(3); 54 | font.setColor(WHITE); 55 | } 56 | 57 | void rainbow() 58 | { 59 | for(int i=0;i<128;i+=4) { 60 | uint8_t r,g,b; 61 | lcd.rgbWheel(i*512L/128,&r,&g,&b); 62 | lcd.fillRect(0,i,128,4,RGBto565(r,g,b)); 63 | } 64 | } 65 | 66 | void loop() 67 | { 68 | lcd.fillScreen(RGBto565(120,60,30)); 69 | font.printStr(ALIGN_CENTER,SCR_HT/2-8-20,"ST7735"); 70 | font.printStr(ALIGN_CENTER,SCR_HT/2-8+20,"modes"); 71 | delay(2000); 72 | 73 | lcd.fillScreen(BLACK); 74 | rainbow(); 75 | font.setColor(BLACK); 76 | font.printStr(ALIGN_CENTER,50,"Idle mode OFF"); 77 | lcd.idleDisplay(false); delay(2000); 78 | rainbow(); 79 | font.printStr(ALIGN_CENTER,50,"Idle mode ON"); 80 | lcd.idleDisplay(true); delay(4000); 81 | rainbow(); 82 | font.printStr(ALIGN_CENTER,50,"Idle mode OFF"); 83 | lcd.idleDisplay(false); delay(2000); 84 | 85 | rainbow(); 86 | font.setColor(WHITE,BLACK); 87 | lcd.fillRect(10,46,SCR_WD-20,22,BLACK); 88 | font.printStr(ALIGN_CENTER,50,"Invert OFF"); 89 | lcd.invertDisplay(false); delay(2000); 90 | font.printStr(ALIGN_CENTER,50," Invert ON "); 91 | lcd.invertDisplay(true); delay(4000); 92 | font.printStr(ALIGN_CENTER,50,"Invert OFF"); 93 | lcd.invertDisplay(false); delay(2000); 94 | 95 | font.setColor(WHITE); 96 | lcd.fillScreen(RGBto565(180,0,180)); 97 | font.printStr(ALIGN_CENTER,SCR_HT/2-8,"Sleep mode 2s"); 98 | delay(2000); 99 | //lcd.enableDisplay(false); 100 | lcd.sleepDisplay(true); delay(4000); 101 | lcd.sleepDisplay(false); 102 | //lcd.enableDisplay(true); 103 | 104 | lcd.fillScreen(RGBto565(180,0,180)); 105 | font.printStr(ALIGN_CENTER,SCR_HT/2-8,"Display on/off"); 106 | delay(2000); 107 | lcd.enableDisplay(false); delay(4000); 108 | lcd.enableDisplay(true); delay(1000); 109 | 110 | lcd.fillScreen(RGBto565(180,0,180)); 111 | font.printStr(ALIGN_CENTER,SCR_HT/2-8,"Partial display"); 112 | font.setColor(YELLOW); 113 | font.printStr(ALIGN_CENTER,4,"Top"); 114 | font.printStr(ALIGN_CENTER,SCR_HT-18,"Bottom"); 115 | font.setColor(WHITE); 116 | delay(2000); 117 | lcd.setPartArea(SCR_HT/4, SCR_HT-SCR_HT/4); lcd.partialDisplay(true); delay(4000); 118 | lcd.setPartArea(SCR_HT-SCR_HT/4, SCR_HT/4); lcd.partialDisplay(true); delay(4000); 119 | lcd.partialDisplay(false); 120 | delay(1000); 121 | 122 | lcd.fillScreen(RGBto565(180,0,0)); 123 | font.printStr(ALIGN_CENTER,SCR_HT/2-8,"Sw reset ..."); 124 | delay(2000); 125 | lcd.resetDisplay(); delay(2000); 126 | lcd.init(); 127 | lcd.fillScreen(RGBto565(0,0,180)); 128 | font.printStr(0,0,"After reset"); delay(2000); 129 | } 130 | 131 | -------------------------------------------------------------------------------- /examples/ST7735_Gauges/ST7735_Gauges.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library example 2 | // Color gauges and progress bars 3 | // (c) 2019 Pawel A. Hernik 4 | // YouTube videos: 5 | // https://youtu.be/rdL3qHEnd4Q 6 | // https://youtu.be/x94y-qH2RBs 7 | 8 | /* 9 | ST7735 128x160 1.8" LCD pinout (header at the top, from left): 10 | #1 LED -> 3.3V 11 | #2 SCK -> SCL/D13/PA5 12 | #3 SDA -> MOSI/D11/PA7 13 | #4 A0/DC -> D8/PA1 or any digital 14 | #5 RESET -> D9/PA0 or any digital 15 | #6 CS -> D10/PA2 or any digital 16 | #7 GND -> GND 17 | #8 VCC -> 3.3V 18 | */ 19 | 20 | #define SCR_WD 128 21 | #define SCR_HT 160 22 | #include 23 | #include 24 | 25 | #if (__STM32F1__) // bluepill 26 | #define TFT_CS PA2 27 | #define TFT_DC PA1 28 | #define TFT_RST PA0 29 | //#include 30 | #else 31 | #define TFT_CS 10 32 | #define TFT_DC 8 33 | #define TFT_RST 9 34 | #include 35 | #endif 36 | 37 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 38 | 39 | #include "RREFont.h" 40 | #include "rre_bold13x20.h" 41 | #include "rre_5x8.h" 42 | 43 | RREFont font; 44 | 45 | // needed for RREFont library initialization, define your fillRect 46 | void customRect(int x, int y, int w, int h, int c) { return lcd.fillRect(x, y, w, h, c); } 47 | 48 | //#include "bold13x20digtop_font.h" 49 | //#include "small4x6_font.h" 50 | 51 | int cx,cy; 52 | int sx,sy; 53 | int xs0,ys0,xe0,ye0; 54 | int xs1,ys1,xe1,ye1; 55 | uint16_t bgCol; 56 | int i; 57 | char buf[20]; 58 | 59 | // ------------------------------------------------ 60 | #define MAXSIN 255 61 | const uint8_t sinTab[91] PROGMEM = { 62 | 0,4,8,13,17,22,26,31,35,39,44,48,53,57,61,65,70,74,78,83,87,91,95,99,103,107,111,115,119,123, 63 | 127,131,135,138,142,146,149,153,156,160,163,167,170,173,177,180,183,186,189,192,195,198,200,203,206,208,211,213,216,218, 64 | 220,223,225,227,229,231,232,234,236,238,239,241,242,243,245,246,247,248,249,250,251,251,252,253,253,254,254,254,254,254, 65 | 255 66 | }; 67 | 68 | int fastSin(int i) 69 | { 70 | while(i<0) i+=360; 71 | while(i>=360) i-=360; 72 | if(i<90) return(pgm_read_byte(&sinTab[i])); else 73 | if(i<180) return(pgm_read_byte(&sinTab[180-i])); else 74 | if(i<270) return(-pgm_read_byte(&sinTab[i-180])); else 75 | return(-pgm_read_byte(&sinTab[360-i])); 76 | } 77 | 78 | int fastCos(int i) 79 | { 80 | return fastSin(i+90); 81 | } 82 | 83 | // ------------------------------------------------ 84 | 85 | void drawGauge1(int level) 86 | { 87 | cx=SCR_WD/2; 88 | cy=SCR_HT/2; 89 | int rx0=40, ry0=40; 90 | int rx1=63, ry1=63; 91 | int mina=-75; 92 | int maxa=180+75; 93 | for(int i=mina; imina) lcd.drawLine(xs0,ys0,lastx,lasty,BLACK); 142 | lastx=xs0; 143 | lasty=ys0; 144 | xs0 = cx+sx*rx2/MAXSIN; 145 | ys0 = cy+sy*rx2/MAXSIN; 146 | snprintf(buf,4,"%d",(i-mina)/8); 147 | font.setFont(&rre_5x8); 148 | font.setColor(RGBto565(150,150,150)); 149 | font.printStr(i==maxa?xs0-4:xs0-2,ys0-2,buf); 150 | } 151 | 152 | int a = map(level,0,100,mina,maxa); 153 | rx1 = rx0-12; 154 | sx = fastCos(a-180); 155 | sy = fastSin(a-180); 156 | xs0 = cx+(sx*rx1+MAXSIN/2)/MAXSIN; 157 | ys0 = cy+(sy*rx1+MAXSIN/2)/MAXSIN; 158 | rx1 = rx0-42; 159 | sx = fastCos(a-180); 160 | sy = fastSin(a-180); 161 | xs1 = cx+(sx*rx1+MAXSIN/2)/MAXSIN; 162 | ys1 = cy+(sy*rx1+MAXSIN/2)/MAXSIN; 163 | rx1 = rx0-42; 164 | sx = fastCos(a-180-8); 165 | sy = fastSin(a-180-8); 166 | xe0 = cx+(sx*rx1+MAXSIN/2)/MAXSIN; 167 | ye0 = cy+(sy*rx1+MAXSIN/2)/MAXSIN; 168 | sx = fastCos(a-180+8); 169 | sy = fastSin(a-180+8); 170 | xe1 = cx+(sx*rx1+MAXSIN/2)/MAXSIN; 171 | ye1 = cy+(sy*rx1+MAXSIN/2)/MAXSIN; 172 | 173 | lcd.drawLine(xs1Old,ys1Old,cx,cy,bgCol); 174 | lcd.fillTriangle(xs0Old,ys0Old,xe0Old,ye0Old,xe1Old,ye1Old,bgCol); 175 | lcd.drawLine(xs1,ys1,cx,cy,BLACK); 176 | lcd.fillTriangle(xs0,ys0,xe0,ye0,xe1,ye1,RED); 177 | lcd.fillCircle(cx,cy,2,BLACK); 178 | xs0Old=xs0; ys0Old=ys0; xs1Old=xs1; ys1Old=ys1; 179 | xe0Old=xe0; ye0Old=ye0; xe1Old=xe1; ye1Old=ye1; 180 | } 181 | 182 | void drawGauge3(int level) 183 | { 184 | cx=SCR_WD/2; 185 | cy=SCR_HT/2; 186 | int rx0=63; 187 | int rx1=rx0-4; 188 | int mina=0; 189 | int maxa=270; 190 | int lastx,lasty; 191 | static int xs0Old=0,ys0Old=0; 192 | for(int i=mina; i<=maxa; i+=3) { 193 | sx = fastCos(i-270); 194 | sy = fastSin(i-270); 195 | xs0 = cx+sx*rx0/MAXSIN; 196 | ys0 = cy+sy*rx0/MAXSIN; 197 | if(i>mina) lcd.drawLine(xs0,ys0,lastx,lasty,WHITE); 198 | lastx=xs0; 199 | lasty=ys0; 200 | } 201 | for(int i=mina; i<=maxa; i+=9) { 202 | sx = fastCos(i-270); 203 | sy = fastSin(i-270); 204 | xs0 = cx+sx*rx0/MAXSIN; 205 | ys0 = cy+sy*rx0/MAXSIN; 206 | if(i%27==0) rx1=rx0-5; else rx1=rx0-3; 207 | xe0 = cx+sx*rx1/MAXSIN; 208 | ye0 = cy+sy*rx1/MAXSIN; 209 | lcd.drawLine(xs0,ys0,xe0,ye0,WHITE); 210 | } 211 | 212 | int a = map(level,0,100,mina,maxa); 213 | rx1=rx0-7; 214 | sx = fastCos(a-270); 215 | sy = fastSin(a-270); 216 | xs0 = cx+sx*rx1/MAXSIN; 217 | ys0 = cy+sy*rx1/MAXSIN; 218 | lcd.drawLine(xs0Old,ys0Old,cx,cy,BLACK); 219 | lcd.drawLine(xs0,ys0,cx,cy,RED); 220 | lcd.fillCircle(cx,cy,2,RED); 221 | xs0Old=xs0; ys0Old=ys0; 222 | 223 | lcd.fillRect(SCR_WD-13*3-2,SCR_HT-20,13*3+2,20,BLACK); 224 | snprintf(buf,10,"%d",level); 225 | font.setFont(&rre_Bold13x20); 226 | font.setCharMinWd(13); 227 | font.setColor(WHITE); 228 | font.printStr(ALIGN_RIGHT,SCR_HT-20,buf); 229 | } 230 | 231 | void drawGauge4(int level) 232 | { 233 | cx=SCR_WD-1; 234 | cy=SCR_HT-1; 235 | int rx0=127-2, ry0=127-2; 236 | int rx1=rx0-20, ry1=ry0-20; 237 | int rx2=rx0+2, ry2=ry0+2; 238 | int mina=0; 239 | int maxa=90; 240 | for(int i=mina; i<=maxa; i+=5) { 241 | sx = fastCos(i-180); 242 | sy = fastSin(i-180); 243 | xs0 = cx+sx*rx0/MAXSIN; 244 | ys0 = cy+sy*ry0/MAXSIN; 245 | xe0 = cx+sx*rx1/MAXSIN; 246 | ye0 = cy+sy*ry1/MAXSIN; 247 | if(i>mina) { 248 | if(i<=level) { 249 | lcd.fillTriangle(xs0,ys0,xe0,ye0,xe1,ye1, lcd.rgbWheel(85*2*(90-i)/90)); 250 | lcd.fillTriangle(xs1,ys1,xe1,ye1,xs0,ys0, lcd.rgbWheel(85*2*(90-i)/90)); 251 | } else { 252 | lcd.fillTriangle(xs0,ys0,xe0,ye0,xe1,ye1, RGBto565(60,60,60)); 253 | lcd.fillTriangle(xs1,ys1,xe1,ye1,xs0,ys0, RGBto565(60,60,60)); 254 | } 255 | } 256 | xs1 = xs0; ys1 = ys0; 257 | xe1 = xe0; ye1 = ye0; 258 | xe0 = cx+sx*rx2/MAXSIN; 259 | ye0 = cy+sy*ry2/MAXSIN; 260 | lcd.drawLine(xs0,ys0,xe0,ye0, YELLOW); 261 | } 262 | lcd.fillRect(SCR_WD-(13*3+2)*1,SCR_HT-20,(13*3+2)*1,20,BLACK); 263 | snprintf(buf,10,"%d",level); 264 | font.setFont(&rre_Bold13x20); 265 | font.setCharMinWd(13); 266 | font.setColor(WHITE); 267 | font.printStr(ALIGN_RIGHT,SCR_HT-20,buf); 268 | } 269 | 270 | void drawBar(int level) 271 | { 272 | int i=level*SCR_WD/100; 273 | lcd.fillRect(0,10,i,15,lcd.rgbWheel(85*2*level/100)); 274 | lcd.fillRect(i,10,SCR_WD-i,15,RGBto565(60,60,60)); 275 | 276 | for(i=0;i100) br=127; else br=30+(127-30)*(br-30)/(100-30); 302 | lcd.fillRect(i*8,SCR_HT-1-barLev[i],7,barLev[i],RGBto565(r*br/127,g*br/127,b*br/127)); 303 | barLevOld[i]=barLev[i]; 304 | } 305 | 306 | for(int i=0;i<16;i++) { 307 | if(!barDec[i]) { 308 | if(barLev[i]>barLevSet[i]) { 309 | barLev[i]-=4; 310 | if(barLev[i]barLevSet[i]) { barLev[i]=barLevSet[i]; barDec[i]=1; } 314 | } 315 | } else { 316 | barLev[i]--; 317 | if(barLev[i]<0) barLev[i]=0; 318 | } 319 | } 320 | int r=random(16); 321 | barLevSet[r]=random(10,SCR_HT); barDec[r]=0; 322 | if(r>0) { barLevSet[r-1]=7*barLevSet[r]/10; barDec[r-1]=0; } 323 | if(r<15) { barLevSet[r+1]=7*barLevSet[r]/10; barDec[r+1]=0; } 324 | } 325 | 326 | unsigned long ms,tm=15000; 327 | 328 | void setup(void) 329 | { 330 | Serial.begin(9600); 331 | lcd.init(); 332 | lcd.fillScreen(BLACK); 333 | font.init(customRect, SCR_WD, SCR_HT); // custom fillRect function and screen width and height values 334 | font.setFont(&rre_5x8); 335 | font.setColor(GREEN); 336 | font.printStr(ALIGN_CENTER,SCR_HT/2-3,"GAUGES DEMO"); 337 | delay(2000); 338 | } 339 | 340 | void loop() 341 | { 342 | lcd.fillScreen(BLACK); 343 | ms=millis(); 344 | while(millis()-ms=0;i-=5) { drawGauge1(i); delay(10); } 348 | delay(250); 349 | } 350 | 351 | lcd.fillScreen(BLACK); 352 | ms=millis(); 353 | while(millis()-ms=0;i-=5) { drawBar(i); delay(60); } 357 | delay(250); 358 | } 359 | 360 | bgCol=RGBto565(220,220,220); 361 | lcd.fillScreen(bgCol); 362 | ms=millis(); 363 | while(millis()-ms=0;i-=2) { drawGauge2(i); delay(10); } 367 | delay(450); 368 | } 369 | 370 | lcd.fillScreen(BLACK); 371 | ms=millis(); 372 | while(millis()-ms=0;i-=2) { drawGauge3(i); delay(40); } 382 | delay(450); 383 | } 384 | 385 | lcd.fillScreen(BLACK); 386 | ms=millis(); 387 | while(millis()-ms=0;i-=5) { drawGauge4(i); delay(40); } 391 | delay(450); 392 | } 393 | } 394 | 395 | 396 | -------------------------------------------------------------------------------- /examples/ST7735_HelloWorld/ST7735_HelloWorld.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library example 2 | // (c) 2019 Pawel A. Hernik 3 | 4 | /* 5 | ST7735 128x160 1.8" LCD pinout (header at the top, from left): 6 | #1 LED -> 3.3V 7 | #2 SCK -> SCL/D13/PA5 8 | #3 SDA -> MOSI/D11/PA7 9 | #4 A0/DC -> D8/PA1 or any digital 10 | #5 RESET -> D9/PA0 or any digital 11 | #6 CS -> D10/PA2 or any digital 12 | #7 GND -> GND 13 | #8 VCC -> 3.3V 14 | */ 15 | 16 | #define SCR_WD 128 17 | #define SCR_HT 160 18 | #include 19 | #include 20 | 21 | #if (__STM32F1__) // bluepill 22 | #define TFT_CS PA2 23 | #define TFT_DC PA1 24 | #define TFT_RST PA0 25 | //#include 26 | #else 27 | #define TFT_CS 10 28 | #define TFT_DC 8 29 | #define TFT_RST 9 30 | #include 31 | #endif 32 | 33 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 34 | 35 | void setup(void) 36 | { 37 | Serial.begin(9600); 38 | lcd.init(); 39 | lcd.fillScreen(BLACK); 40 | lcd.setTextColor(WHITE,BLUE); 41 | int xt=(SCR_WD-11*6)/2, yt=(SCR_HT-8)/2; 42 | lcd.setCursor(xt, yt); 43 | lcd.println("HELLO WORLD"); 44 | lcd.drawRect(xt-10,yt-10,11*6+20,8+20,GREEN); 45 | } 46 | 47 | void loop() 48 | { 49 | } 50 | 51 | -------------------------------------------------------------------------------- /examples/ST7735_Lines/ST7735_Lines.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library example 2 | // (c) 2019 Pawel A. Hernik 3 | 4 | /* 5 | ST7735 128x160 1.8" LCD pinout (header at the top, from left): 6 | #1 LED -> 3.3V 7 | #2 SCK -> SCL/D13/PA5 8 | #3 SDA -> MOSI/D11/PA7 9 | #4 A0/DC -> D8/PA1 or any digital 10 | #5 RESET -> D9/PA0 or any digital 11 | #6 CS -> D10/PA2 or any digital 12 | #7 GND -> GND 13 | #8 VCC -> 3.3V 14 | */ 15 | 16 | #define SCR_WD 128 17 | #define SCR_HT 160 18 | #include 19 | #include 20 | 21 | #if (__STM32F1__) // bluepill 22 | #define TFT_CS PA2 23 | #define TFT_DC PA1 24 | #define TFT_RST PA0 25 | //#include 26 | #else 27 | #define TFT_CS 10 28 | #define TFT_DC 8 29 | #define TFT_RST 9 30 | #include 31 | #endif 32 | 33 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 34 | 35 | void setup() 36 | { 37 | Serial.begin(9600); 38 | lcd.init(); 39 | lcd.fillScreen(BLACK); 40 | /* 41 | for(int i=0;i<128;i++) { 42 | lcd.fillRect(32*0,i,32,1,RGBto565(i*2,0,0)); 43 | lcd.fillRect(32*1,i,32,1,RGBto565(0,i*2,0)); 44 | lcd.fillRect(32*2,i,32,1,RGBto565(0,0,i*2)); 45 | lcd.fillRect(32*3,i,32,1,RGBto565(i*2,i*2,i*2)); 46 | } 47 | delay(2000); 48 | */ 49 | } 50 | 51 | void circles() 52 | { 53 | int x,y; 54 | x = 15+random(SCR_WD-30); 55 | y = 15+random(SCR_HT-30); 56 | lcd.fillCircle(x,y,15,random()); 57 | lcd.drawCircle(x,y,16,YELLOW); 58 | } 59 | 60 | #define MAX_LINES 16 61 | byte lx0[MAX_LINES]; 62 | byte lx1[MAX_LINES]; 63 | byte ly0[MAX_LINES]; 64 | byte ly1[MAX_LINES]; 65 | byte curLine=0; 66 | int x0=40,y0=0; 67 | int dx0=6,dy0=5; 68 | int x1=80,y1=40; 69 | int dx1=9,dy1=8; 70 | int cc=0; 71 | int numLines=12; 72 | 73 | void animLines(int mode) 74 | { 75 | uint16_t c; 76 | x0+=dx0; 77 | y0+=dy0; 78 | x1+=dx1; 79 | y1+=dy1; 80 | if(x0>SCR_WD-1) { dx0=-dx0; x0=SCR_WD-1; } 81 | if(x0<1) { dx0=-dx0; x0=0; } 82 | if(y0>SCR_HT-1) { dy0=-dy0; y0=SCR_HT-1; } 83 | if(y0<1) { dy0=-dy0; y0=0; } 84 | if(x1>SCR_WD-1) { dx1=-dx1; x1=SCR_WD-1; } 85 | if(x1<1) { dx1=-dx1; x1=0; } 86 | if(y1>SCR_HT-1) { dy1=-dy1; y1=SCR_HT-1; } 87 | if(y1<1) { dy1=-dy1; y1=0; } 88 | int i=curLine; 89 | if(mode&1) lcd.drawLine(lx0[i],ly0[i],lx1[i],ly1[i], 0); 90 | if(mode&2) lcd.drawLine(SCR_WD-1-lx0[i],ly0[i],SCR_WD-1-lx1[i],ly1[i],0); 91 | if(mode&4) lcd.drawLine(lx0[i],SCR_HT-1-ly0[i],lx1[i],SCR_HT-1-ly1[i],0); 92 | if(mode&8) lcd.drawLine(SCR_WD-1-lx0[i],SCR_HT-1-ly0[i],SCR_WD-1-lx1[i],SCR_HT-1-ly1[i],0); 93 | lx0[curLine]=x0; 94 | lx1[curLine]=x1; 95 | ly0[curLine]=y0; 96 | ly1[curLine]=y1; 97 | if(++curLine>=numLines) curLine=0; 98 | for(int i=0;i 3.3V 10 | #2 SCK -> SCL/D13/PA5 11 | #3 SDA -> MOSI/D11/PA7 12 | #4 A0/DC -> D8/PA1 or any digital 13 | #5 RESET -> D9/PA0 or any digital 14 | #6 CS -> D10/PA2 or any digital 15 | #7 GND -> GND 16 | #8 VCC -> 3.3V 17 | */ 18 | 19 | #define SCR_WD 128 20 | #define SCR_HT 160 21 | #include 22 | #include 23 | 24 | #if (__STM32F1__) // bluepill 25 | #define TFT_CS PA2 26 | #define TFT_DC PA1 27 | #define TFT_RST PA0 28 | //#include 29 | #else 30 | #define TFT_CS 10 31 | #define TFT_DC 8 32 | #define TFT_RST 9 33 | #include 34 | #endif 35 | 36 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 37 | 38 | #include "RREFont.h" 39 | 40 | #include "rre_mario0.h" 41 | #include "rre_mario1.h" 42 | #include "rre_mario2.h" 43 | #include "rre_mario3.h" 44 | #include "rre_mario4.h" 45 | #include "rre_mario5.h" 46 | #include "rre_mario6.h" 47 | /* 48 | #include "rre_mario0_v.h" 49 | #include "rre_mario2_v.h" 50 | #include "rre_mario3_v.h" 51 | #include "rre_mario4_v.h" 52 | #include "rre_mario5_v.h" 53 | #include "rre_mario6_v.h" 54 | */ 55 | RREFont font; 56 | 57 | // needed for RREFont library initialization, define your fillRect 58 | void customRect(int x, int y, int w, int h, int c) { return lcd.fillRect(x, y, w, h, c); } 59 | 60 | int sx=64, sy=64, sx0=0, sy0=0; 61 | // special callback with scale&translation feature 62 | void customRectScale(int x, int y, int w, int h, int c) 63 | { 64 | int xx=(x-sx0)*sx>>6, yy=(y-sy0)*sy>>6, ww=((w+x-sx0)*sx>>6)-xx, hh=((h+y-sy0)*sy>>6)-yy; 65 | xx+=sx0; 66 | yy+=sy0; 67 | return lcd.fillRect(xx, yy, ww, hh, c); 68 | } 69 | 70 | void showMarioV() 71 | { 72 | delay(1000); 73 | font.setFont(&rre_mario0); font.setScale(1); font.setSpacing(0); 74 | font.setColor(RGBto565(15,9,8)); 75 | font.printStr(0,0," "); 76 | delay(1000); 77 | font.setFont(&rre_mario2); font.setScale(1); font.setSpacing(0); 78 | font.setColor(RGBto565(113,59,29)); 79 | font.printStr(0,0," "); 80 | delay(1000); 81 | font.setFont(&rre_mario3); font.setScale(1); font.setSpacing(0); 82 | font.setColor(RGBto565(253,212,133)); 83 | font.printStr(0,0," "); 84 | delay(1000); 85 | font.setFont(&rre_mario4); font.setScale(1); font.setSpacing(0); 86 | font.setColor(RGBto565(237,53,15)); 87 | font.printStr(0,0," "); 88 | delay(1000); 89 | font.setFont(&rre_mario5); font.setScale(1); font.setSpacing(0); 90 | font.setColor(RGBto565(249,249,248)); 91 | font.printStr(0,0," "); 92 | delay(1000); 93 | font.setFont(&rre_mario6); font.setScale(1); font.setSpacing(0); 94 | font.setColor(RGBto565(9,69,163)); 95 | font.printStr(0,0," "); 96 | } 97 | 98 | uint16_t bg=RGBto565(157,156,154); 99 | int del=0; 100 | 101 | void showMario(int x, int y) 102 | { 103 | font.setFont(&rre_mario1); font.setScale(1); 104 | font.setColor(bg); 105 | font.printStr(x,y," "); font.printStr(x+48,y,"!"); font.printStr(x,y+64,"\""); font.printStr(x+48,y+64,"#"); 106 | delay(del); 107 | font.setFont(&rre_mario0); font.setScale(1); 108 | font.setColor(RGBto565(15,9,8)); 109 | font.printStr(x,y," "); font.printStr(x+48,y,"!"); font.printStr(x,y+64,"\""); font.printStr(x+48,y+64,"#"); 110 | delay(del); 111 | font.setFont(&rre_mario2); font.setScale(1); 112 | font.setColor(RGBto565(113,59,29)); 113 | font.printStr(x,y," "); font.printStr(x+48,y,"!"); font.printStr(x,y+64,"\""); font.printStr(x+48,y+64,"#"); 114 | delay(del); 115 | font.setFont(&rre_mario3); font.setScale(1); 116 | font.setColor(RGBto565(253,212,133)); 117 | font.printStr(x,y," "); font.printStr(x+48,y,"!"); font.printStr(x,y+64,"\""); font.printStr(x+48,y+64,"#"); 118 | delay(del); 119 | font.setFont(&rre_mario4); font.setScale(1); 120 | font.setColor(RGBto565(237,53,15)); 121 | font.printStr(x,y," "); font.printStr(x+48,y,"!"); font.printStr(x,y+64,"\""); font.printStr(x+48,y+64,"#"); 122 | delay(del); 123 | font.setFont(&rre_mario5); font.setScale(1); 124 | font.setColor(RGBto565(249,249,248)); 125 | font.printStr(x,y," "); font.printStr(x+48,y,"!"); font.printStr(x,y+64,"\""); font.printStr(x+48,y+64,"#"); 126 | delay(del); 127 | font.setFont(&rre_mario6); font.setScale(1); 128 | font.setColor(RGBto565(9,69,163)); 129 | font.printStr(x,y," "); font.printStr(x+48,y,"!"); font.printStr(x,y+64,"\""); font.printStr(x+48,y+64,"#"); 130 | } 131 | 132 | 133 | void setup() 134 | { 135 | Serial.begin(9600); 136 | lcd.init(); 137 | lcd.fillScreen(bg); // c1 138 | // font.init(customRect, SCR_WD, SCR_HT); // custom fillRect function and screen width and height values 139 | font.init(customRectScale, SCR_WD, SCR_HT); // custom fillRect function and screen width and height values 140 | 141 | del=0; 142 | showMario(16,0); 143 | delay(2000); 144 | lcd.fillScreen(bg); // c1 145 | del=1000; 146 | showMario(16,0); 147 | del=0; 148 | delay(2000); 149 | } 150 | 151 | 152 | void loop() 153 | { 154 | lcd.fillScreen(bg); // c1 155 | for(int j=0;j<4;j++) { 156 | sx0=64; sy0=64; 157 | for(int i=64;i>8;i-=2) { 158 | if(j==2) { sx=64;sy=i; } else 159 | if(j==3) { sx=i;sy=64; } else { sx=i;sy=i; } 160 | showMario(16,0); 161 | int w=96*i>>6; 162 | int h=128*i>>6; 163 | if(j<2) { 164 | lcd.fillRect(64-(48*i>>6), 64-(64*i>>6), w,2, bg); 165 | lcd.fillRect(64-(48*i>>6), 64+(64*i>>6)-2, w,2, bg); 166 | lcd.fillRect(64-(48*i>>6)-1, 64-(64*i>>6), 2,h, bg); 167 | lcd.fillRect(64+(48*i>>6)-2, 64-(64*i>>6), 2,h, bg); 168 | } else 169 | if(j==2) { 170 | lcd.fillRect(16, 64-(64*i>>6), 96,2, bg); 171 | lcd.fillRect(16, 64+(64*i>>6)-2, 96,2, bg); 172 | } else 173 | if(j==3) { 174 | lcd.fillRect(64-(48*i>>6)-1, 0, 2,128, bg); 175 | lcd.fillRect(64+(48*i>>6)-2, 0, 2,128, bg); 176 | } 177 | } 178 | for(int i=8;i<=64;i+=2) { 179 | if(j==2) { sx=64;sy=i; } else 180 | if(j==3) { sx=i;sy=64; } else { sx=i;sy=i; } 181 | showMario(16,0); 182 | } 183 | } 184 | for(int j=0;j<200;j++) { 185 | sx=sy=random(8,64); 186 | sx0=sy0=0; 187 | showMario(random(0,128),random(0,128)); 188 | } 189 | } 190 | 191 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario0.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario0_h__ 2 | #define __font_mario0_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario0] 48x64 7 | Total chars: 4 (' ' to '#') 8 | Total rects: 456 * 3 bytes 9 | Total pixels: 3519 (742 overlapping) 10 | Total bytes: 1376 (1368 rects + 8 offs) 11 | Bitmap size: 1536 (48x64 * 4) (+4 opt) 12 | */ 13 | 14 | const unsigned char fontmario0_Rects[1368] PROGMEM = { 15 | 0xcb,0xa5,0x01, 0x53,0x3e,0x0b, 0x68,0x02,0x07, 0xcd,0x70,0x01, 0x95,0x56,0x01, 0x93,0x5c,0x01, 0x5e,0x23,0x06, 0xdb,0x0c,0x02, 0xd7,0x12,0x02, 0x64,0x04,0x04, 0x13,0x2b,0x09, 0xa0,0x07,0x02, 0x8f,0x21,0x02, 0xde,0x09,0x01, 0xca,0x67,0x00, 0x99,0x0f,0x02, 16 | 0x8c,0x23,0x02, 0x0e,0x76,0x01, 0x62,0x06,0x03, 0xa2,0x2e,0x01, 0x90,0x3a,0x01, 0xda,0x29,0x01, 0xd6,0x14,0x02, 0x94,0x59,0x01, 0x2b,0x01,0x04, 0x11,0x2c,0x04, 0x21,0x33,0x04, 0x11,0x3d,0x04, 0x66,0x03,0x05, 0x6e,0x15,0x01, 0xd2,0x1f,0x00, 0x25,0x23,0x03, 17 | 0x60,0x26,0x01, 0x5b,0x27,0x01, 0x50,0x2d,0x01, 0xcf,0x2f,0x00, 0x5f,0x3d,0x01, 0x20,0x3f,0x03, 0x5d,0x0a,0x03, 0xab,0x0e,0x00, 0x2b,0x17,0x02, 0x28,0x19,0x02, 0x25,0x1b,0x02, 0x2b,0x21,0x02, 0x28,0x22,0x02, 0x93,0x23,0x00, 0x9d,0x24,0x00, 0x24,0x2c,0x02, 18 | 0x9d,0x2d,0x00, 0xa7,0x2d,0x00, 0xa5,0x30,0x00, 0xd2,0x3b,0x00, 0x5a,0x4e,0x00, 0xcc,0x2e,0x01, 0x6c,0x0b,0x00, 0x57,0x18,0x00, 0x2a,0x18,0x01, 0x27,0x1a,0x01, 0x24,0x1c,0x01, 0x23,0x1d,0x01, 0x22,0x1e,0x01, 0x21,0x1f,0x01, 0x20,0x20,0x01, 0x2e,0x20,0x01, 19 | 0x1f,0x21,0x01, 0x61,0x28,0x00, 0x62,0x29,0x00, 0x63,0x2a,0x00, 0x5c,0x2c,0x00, 0x5e,0x2f,0x00, 0x66,0x2f,0x00, 0x5f,0x30,0x00, 0x60,0x31,0x00, 0x5a,0x33,0x00, 0x5b,0x34,0x00, 0x2e,0x36,0x01, 0xe3,0x05,0x00, 0x5c,0x4b,0x00, 0x8e,0x22,0x01, 0x8f,0x39,0x01, 20 | 0x9f,0x08,0x02, 0x2f,0x00,0x00, 0x26,0x06,0x00, 0x2f,0x08,0x00, 0x2e,0x09,0x00, 0x2d,0x0a,0x00, 0x1e,0x0d,0x00, 0x18,0x11,0x00, 0x2c,0x13,0x00, 0x2d,0x14,0x00, 0x2d,0x16,0x00, 0x11,0x20,0x00, 0x1f,0x22,0x00, 0x1e,0x25,0x00, 0x20,0x25,0x00, 0x0d,0x26,0x00, 21 | 0x1c,0x26,0x00, 0x24,0x2b,0x00, 0x12,0x2d,0x00, 0x26,0x2d,0x00, 0x24,0x2e,0x00, 0x10,0x2f,0x00, 0x21,0x2f,0x00, 0x17,0x31,0x00, 0x23,0x31,0x00, 0x19,0x32,0x00, 0x21,0x32,0x00, 0x23,0x34,0x00, 0x2f,0x37,0x00, 0x1b,0x38,0x00, 0x1a,0x39,0x00, 0x13,0x3c,0x00, 22 | 0x21,0x3e,0x00, 0xed,0x6e,0x02, 0x82,0x75,0x17, 0xcf,0x17,0x0a, 0x40,0x72,0x0b, 0x44,0xb4,0x0c, 0x96,0x15,0x09, 0xea,0x90,0x01, 0x9f,0xa5,0x01, 0x98,0x07,0x06, 0xce,0x0d,0x04, 0x4d,0x5e,0x02, 0x64,0x5f,0x02, 0x41,0x63,0x02, 0x40,0x01,0x07, 0x52,0x21,0x07, 23 | 0xa1,0x0a,0x04, 0x9e,0x25,0x06, 0x54,0x10,0x06, 0x95,0x0a,0x03, 0x8d,0x48,0x01, 0x19,0x73,0x02, 0x28,0x5a,0x01, 0x50,0x1b,0x04, 0x9e,0x6c,0x01, 0x88,0x03,0x02, 0xa6,0x0c,0x02, 0x95,0x3c,0x02, 0xa9,0x4e,0x01, 0x01,0xb1,0x06, 0xcb,0x05,0x01, 0x5b,0x11,0x03, 24 | 0xdc,0x31,0x01, 0xe6,0x1d,0x02, 0x4d,0x18,0x0e, 0x93,0x0b,0x02, 0x43,0x02,0x06, 0x52,0x56,0x05, 0x9f,0x09,0x01, 0x0b,0x11,0x05, 0x5d,0x13,0x02, 0x5b,0x23,0x02, 0xc0,0x22,0x02, 0xc2,0x26,0x02, 0xe9,0x56,0x01, 0x80,0x2f,0x01, 0xc2,0xf0,0x00, 0x56,0x74,0x04, 25 | 0x00,0x00,0x03, 0x02,0x07,0x03, 0x07,0x12,0x03, 0x04,0x13,0x03, 0x61,0x17,0x01, 0x51,0x1d,0x01, 0x52,0x1f,0x01, 0xd0,0x20,0x00, 0x13,0x3f,0x03, 0x4a,0x06,0x03, 0x5e,0x28,0x03, 0x11,0x0c,0x09, 0xa4,0x0b,0x03, 0xe3,0x23,0x02, 0x03,0x3c,0x10, 0x8f,0x0a,0x00, 26 | 0x1a,0x0d,0x02, 0x02,0x14,0x02, 0x07,0x1b,0x02, 0x05,0x1c,0x02, 0x21,0x20,0x02, 0x5a,0x22,0x01, 0x56,0x09,0x03, 0xe8,0x0d,0x01, 0x9d,0x08,0x02, 0x4c,0x09,0x00, 0x4a,0x0a,0x00, 0x4b,0x0c,0x00, 0x1c,0x0e,0x01, 0x1d,0x0f,0x01, 0x00,0x15,0x01, 0x1c,0x18,0x01, 27 | 0x0b,0x19,0x01, 0x09,0x1a,0x01, 0x04,0x1d,0x01, 0x0d,0x1d,0x01, 0x02,0x1e,0x01, 0x00,0x1f,0x01, 0x1e,0x20,0x01, 0x01,0x21,0x01, 0x1c,0x25,0x01, 0x0c,0x33,0x01, 0x47,0x3e,0x00, 0x0a,0x3e,0x01, 0x50,0x3e,0x00, 0x09,0x3f,0x01, 0x07,0x04,0x04, 0x22,0x64,0x00, 28 | 0x67,0x5c,0x00, 0xdd,0x30,0x01, 0xdb,0x32,0x01, 0x00,0x08,0x00, 0x07,0x08,0x00, 0x17,0x08,0x00, 0x09,0x09,0x00, 0x13,0x0e,0x00, 0x27,0x0f,0x00, 0x13,0x10,0x00, 0x1e,0x10,0x00, 0x20,0x17,0x00, 0x23,0x18,0x00, 0x11,0x22,0x00, 0x0e,0x24,0x00, 0x0d,0x25,0x00, 29 | 0x1d,0x26,0x00, 0x03,0x2a,0x00, 0x1e,0x2a,0x00, 0x03,0x30,0x00, 0x18,0x3c,0x00, 0x11,0x3d,0x00, 0x14,0x3e,0x00, 0x0f,0x3f,0x00, 0xac,0x52,0x00, 0x98,0x00,0x0c, 0x23,0x22,0x41, 0x92,0x3c,0x0a, 0x8b,0xeb,0x01, 0x8a,0x08,0x07, 0x49,0x24,0x0b, 0xa0,0x72,0x02, 30 | 0x41,0x94,0x01, 0x4f,0xb3,0x01, 0x9a,0x4e,0x01, 0x2b,0xc5,0x00, 0x13,0x1f,0x0c, 0xc7,0x0b,0x02, 0xa5,0x28,0x05, 0x9c,0x94,0x00, 0x9e,0xa4,0x00, 0x54,0x03,0x04, 0x1e,0x16,0x09, 0x0d,0x66,0x01, 0x4a,0xae,0x00, 0x84,0x20,0x02, 0xa0,0x21,0x02, 0x9e,0x39,0x02, 31 | 0x65,0x03,0x03, 0x51,0x05,0x03, 0xdc,0x0c,0x01, 0xef,0x50,0x00, 0x87,0x22,0x02, 0x90,0x6c,0x00, 0x02,0x5b,0x01, 0x65,0xa7,0x00, 0x85,0x0e,0x01, 0x83,0x10,0x01, 0x88,0x15,0x01, 0x97,0x20,0x01, 0x8d,0x39,0x01, 0x4f,0x06,0x03, 0xdd,0x3a,0x01, 0x4c,0x68,0x01, 32 | 0x08,0x0a,0x0d, 0x2c,0x4a,0x00, 0x1d,0x58,0x00, 0x11,0x68,0x00, 0x15,0x3f,0x04, 0x2a,0x06,0x05, 0xc2,0x12,0x01, 0x56,0x02,0x05, 0x62,0x6e,0x01, 0x1f,0x76,0x02, 0x69,0x04,0x01, 0x66,0x05,0x01, 0xce,0x16,0x00, 0x21,0x17,0x03, 0x54,0x1d,0x01, 0x1d,0x20,0x03, 33 | 0x55,0x23,0x01, 0xd1,0x3a,0x00, 0x9d,0x0b,0x01, 0x63,0x02,0x03, 0x15,0x00,0x02, 0x23,0x08,0x02, 0x21,0x09,0x02, 0x1f,0x0a,0x02, 0x14,0x0b,0x02, 0x16,0x0c,0x02, 0xaa,0x11,0x00, 0x26,0x15,0x02, 0x8d,0x18,0x00, 0x9b,0x1c,0x00, 0x9f,0x23,0x00, 0x1b,0x15,0x03, 34 | 0x47,0x17,0x01, 0x83,0x1e,0x01, 0x06,0x23,0x05, 0x1b,0x4d,0x01, 0x25,0x07,0x01, 0x18,0x0d,0x01, 0x69,0x13,0x00, 0x6e,0x13,0x00, 0x4f,0x15,0x00, 0x40,0x18,0x00, 0x15,0x1c,0x01, 0x13,0x20,0x01, 0x65,0x24,0x00, 0x52,0x26,0x00, 0x04,0x0f,0x03, 0x1a,0x1e,0x03, 35 | 0x16,0x20,0x03, 0x56,0x22,0x01, 0x0c,0x26,0x03, 0x26,0x67,0x00, 0x53,0x04,0x02, 0x89,0x09,0x01, 0x8c,0x38,0x01, 0x5c,0x3b,0x03, 0x25,0x01,0x00, 0x2c,0x05,0x00, 0x0e,0x07,0x00, 0x2a,0x07,0x00, 0x2f,0x07,0x00, 0x12,0x09,0x00, 0x1f,0x0b,0x00, 0x0a,0x0e,0x00, 36 | 0x19,0x0e,0x00, 0x05,0x11,0x00, 0x09,0x14,0x00, 0x28,0x14,0x00, 0x1b,0x16,0x00, 0x05,0x1f,0x00, 0x07,0x21,0x00, 0x1f,0x21,0x00, 0x21,0x31,0x00, 0x12,0x3b,0x00, 0xa8,0x29,0x07, 0x99,0x25,0x0c, 0x9c,0x06,0x09, 0x17,0xcb,0x01, 0xd4,0x99,0x01, 0x81,0x28,0x07, 37 | 0xd1,0x09,0x04, 0x0e,0x44,0x02, 0x2a,0x56,0x02, 0x26,0x5d,0x02, 0x95,0x56,0x02, 0x55,0x24,0x0b, 0xa8,0x49,0x01, 0xd1,0x20,0x02, 0xce,0x23,0x02, 0x8a,0x26,0x03, 0x00,0x06,0x0a, 0x19,0x48,0x01, 0xa8,0x1a,0x03, 0xe4,0x22,0x02, 0x92,0x00,0x02, 0x16,0x8a,0x00, 38 | 0xa3,0x07,0x04, 0x49,0x04,0x03, 0xaa,0x0b,0x02, 0x07,0x0b,0x06, 0x01,0x0e,0x06, 0x01,0x19,0x06, 0x90,0x02,0x02, 0x91,0x87,0x00, 0x80,0x29,0x04, 0x9a,0x07,0x03, 0x87,0x27,0x03, 0x6b,0x53,0x02, 0x00,0x07,0x04, 0x0a,0x52,0x00, 0xe8,0x88,0x00, 0x93,0x1c,0x03, 39 | 0x25,0x5f,0x02, 0x03,0x03,0x03, 0x05,0x0c,0x03, 0xd2,0x11,0x00, 0xd9,0x12,0x00, 0xe7,0x13,0x00, 0x20,0x28,0x03, 0xa9,0x58,0x00, 0xd7,0x23,0x01, 0x55,0x0d,0x04, 0x10,0x61,0x01, 0x07,0x05,0x0a, 0xa7,0x0a,0x03, 0x82,0x00,0x00, 0x88,0x00,0x00, 0x1f,0x05,0x02, 40 | 0x84,0x09,0x00, 0x93,0x13,0x00, 0x80,0x16,0x00, 0x03,0x1a,0x02, 0xa3,0x1d,0x00, 0xa2,0x1f,0x00, 0x0c,0x42,0x00, 0x4f,0x08,0x03, 0x58,0x09,0x03, 0xcd,0x24,0x01, 0xeb,0x0c,0x02, 0x0e,0x00,0x01, 0x55,0x00,0x00, 0x0d,0x01,0x01, 0x06,0x02,0x01, 0x4d,0x06,0x00, 41 | 0x0a,0x07,0x01, 0x02,0x08,0x01, 0x4c,0x09,0x00, 0x00,0x0f,0x01, 0x49,0x10,0x00, 0x54,0x15,0x00, 0x49,0x16,0x00, 0x48,0x17,0x00, 0x66,0x17,0x00, 0x01,0x18,0x01, 0x65,0x19,0x00, 0x64,0x1b,0x00, 0x12,0x1f,0x01, 0x61,0x21,0x00, 0x56,0x22,0x00, 0x60,0x22,0x00, 42 | 0x0f,0x03,0x04, 0x67,0x1c,0x03, 0x09,0x00,0x00, 0x11,0x01,0x00, 0x03,0x02,0x00, 0x0d,0x02,0x00, 0x0b,0x03,0x00, 0x0b,0x08,0x00, 0x03,0x09,0x00, 0x0d,0x0a,0x00, 0x10,0x0a,0x00, 0x26,0x0a,0x00, 0x05,0x0b,0x00, 0x04,0x0d,0x00, 0x14,0x0d,0x00, 0x08,0x0f,0x00, 43 | 0x00,0x10,0x00, 0x16,0x15,0x00, 0x07,0x18,0x00, 0x1f,0x23,0x00, 0x12,0x24,0x00, 0x23,0x24,0x00, 0x0c,0x25,0x00, 0x2c,0x8d,0x02, 44 | }; 45 | 46 | const unsigned short fontmario0_CharOffs[5] PROGMEM = { 47 | 0x0000, 0x0072, 0x00e9, 0x015b, 0x01c8, 48 | }; 49 | 50 | RRE_Font rre_mario0 = { RRE_24B, 48,64, 0x20, 0x23, (const uint8_t*)fontmario0_Rects, (const uint16_t*)fontmario0_CharOffs }; 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario0_v.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario0_h__ 2 | #define __font_mario0_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario0] 96x128 7 | Total chars: 1 (' ' to ' ') 8 | Total rects: 647 * 3 bytes 9 | Total pixels: 2777 (4 overlapping) 10 | Total bytes: 1943 (1941 rects + 2 offs) 11 | Bitmap size: 1536 (96x128 * 1) (+1 opt) 12 | */ 13 | 14 | const unsigned char fontmario0_Rects[1941] PROGMEM = { 15 | 0x00,0x58,0x01, 0x01,0x54,0x09, 0x02,0x52,0x0d, 0x03,0x50,0x05, 0x03,0x5b,0x05, 0x04,0x4f,0x03, 0x04,0x5e,0x04, 0x05,0x4e,0x03, 0x05,0x5f,0x03, 0x06,0x4e,0x02, 0x06,0x60,0x03, 0x07,0x4b,0x04, 0x07,0x57,0x01, 0x07,0x61,0x03, 0x08,0x4a,0x04, 0x08,0x55,0x03, 16 | 0x08,0x62,0x02, 0x09,0x49,0x05, 0x09,0x54,0x03, 0x09,0x62,0x03, 0x0a,0x27,0x07, 0x0a,0x48,0x03, 0x0a,0x4e,0x00, 0x0a,0x63,0x02, 0x0a,0x6e,0x09, 0x0b,0x25,0x0b, 0x0b,0x48,0x02, 0x0b,0x63,0x02, 0x0b,0x6b,0x0e, 0x0c,0x23,0x0e, 0x0c,0x48,0x02, 0x0c,0x64,0x02, 17 | 0x0c,0x68,0x12, 0x0d,0x23,0x03, 0x0d,0x2e,0x09, 0x0d,0x48,0x02, 0x0d,0x58,0x02, 0x0d,0x64,0x09, 0x0d,0x78,0x03, 0x0e,0x22,0x03, 0x0e,0x30,0x0a, 0x0e,0x47,0x03, 0x0e,0x56,0x03, 0x0e,0x64,0x06, 0x0e,0x79,0x02, 0x0f,0x21,0x03, 0x0f,0x2f,0x03, 0x0f,0x36,0x05, 18 | 0x0f,0x46,0x04, 0x0f,0x55,0x01, 0x0f,0x64,0x02, 0x0f,0x73,0x09, 0x10,0x21,0x02, 0x10,0x2d,0x02, 0x10,0x39,0x03, 0x10,0x46,0x04, 0x10,0x64,0x01, 0x10,0x6c,0x10, 0x11,0x20,0x03, 0x11,0x2c,0x02, 0x11,0x3a,0x03, 0x11,0x45,0x05, 0x11,0x64,0x01, 0x11,0x68,0x04, 19 | 0x11,0x7a,0x03, 0x12,0x1f,0x03, 0x12,0x2c,0x01, 0x12,0x3b,0x03, 0x12,0x45,0x02, 0x12,0x49,0x01, 0x12,0x64,0x03, 0x12,0x7b,0x03, 0x13,0x1c,0x09, 0x13,0x2b,0x01, 0x13,0x3c,0x03, 0x13,0x44,0x02, 0x13,0x4a,0x00, 0x13,0x5f,0x01, 0x13,0x64,0x01, 0x13,0x7c,0x02, 20 | 0x14,0x19,0x09, 0x14,0x2b,0x01, 0x14,0x3d,0x02, 0x14,0x43,0x03, 0x14,0x4a,0x01, 0x14,0x5d,0x03, 0x14,0x64,0x01, 0x14,0x7c,0x02, 0x15,0x16,0x09, 0x15,0x2b,0x01, 0x15,0x3d,0x03, 0x15,0x43,0x02, 0x15,0x4a,0x01, 0x15,0x5c,0x03, 0x15,0x63,0x01, 0x15,0x7c,0x03, 21 | 0x16,0x14,0x08, 0x16,0x2b,0x00, 0x16,0x3e,0x02, 0x16,0x42,0x02, 0x16,0x4b,0x01, 0x16,0x5c,0x00, 0x16,0x5f,0x01, 0x16,0x62,0x02, 0x16,0x7c,0x03, 0x17,0x12,0x07, 0x17,0x2b,0x00, 0x17,0x31,0x00, 0x17,0x3e,0x02, 0x17,0x42,0x02, 0x17,0x4c,0x00, 0x17,0x5f,0x04, 22 | 0x17,0x7c,0x03, 0x18,0x11,0x06, 0x18,0x2b,0x00, 0x18,0x3e,0x06, 0x18,0x4c,0x01, 0x18,0x5f,0x03, 0x18,0x7c,0x03, 0x19,0x0f,0x06, 0x19,0x2b,0x00, 0x19,0x32,0x00, 0x19,0x3e,0x05, 0x19,0x4d,0x01, 0x19,0x5f,0x01, 0x19,0x7c,0x03, 0x1a,0x0e,0x05, 0x1a,0x29,0x03, 23 | 0x1a,0x33,0x01, 0x1a,0x39,0x00, 0x1a,0x3e,0x05, 0x1a,0x4e,0x06, 0x1a,0x5e,0x01, 0x1a,0x7c,0x02, 0x1b,0x0c,0x05, 0x1b,0x27,0x05, 0x1b,0x34,0x01, 0x1b,0x38,0x00, 0x1b,0x3e,0x05, 0x1b,0x4d,0x09, 0x1b,0x5c,0x03, 0x1b,0x7c,0x02, 0x1c,0x0b,0x05, 0x1c,0x26,0x02, 24 | 0x1c,0x2b,0x02, 0x1c,0x3e,0x04, 0x1c,0x4c,0x05, 0x1c,0x54,0x0b, 0x1c,0x7b,0x03, 0x1d,0x0a,0x05, 0x1d,0x24,0x02, 0x1d,0x2d,0x02, 0x1d,0x3e,0x04, 0x1d,0x4b,0x04, 0x1d,0x55,0x00, 0x1d,0x58,0x04, 0x1d,0x5e,0x02, 0x1d,0x7a,0x03, 0x1e,0x09,0x04, 0x1e,0x23,0x02, 25 | 0x1e,0x2f,0x01, 0x1e,0x3e,0x04, 0x1e,0x4b,0x02, 0x1e,0x55,0x01, 0x1e,0x5f,0x01, 0x1e,0x64,0x0a, 0x1e,0x79,0x04, 0x1f,0x08,0x04, 0x1f,0x21,0x03, 0x1f,0x30,0x01, 0x1f,0x3d,0x01, 0x1f,0x40,0x02, 0x1f,0x4a,0x01, 0x1f,0x56,0x00, 0x1f,0x5f,0x02, 0x1f,0x63,0x02, 26 | 0x1f,0x76,0x06, 0x20,0x07,0x04, 0x20,0x20,0x01, 0x20,0x23,0x04, 0x20,0x31,0x01, 0x20,0x3d,0x05, 0x20,0x4a,0x00, 0x20,0x56,0x00, 0x20,0x60,0x03, 0x20,0x72,0x09, 0x21,0x07,0x03, 0x21,0x1f,0x01, 0x21,0x23,0x01, 0x21,0x26,0x03, 0x21,0x2f,0x00, 0x21,0x32,0x01, 27 | 0x21,0x3e,0x04, 0x21,0x49,0x01, 0x21,0x56,0x01, 0x21,0x61,0x02, 0x21,0x71,0x09, 0x22,0x06,0x03, 0x22,0x1e,0x01, 0x22,0x23,0x01, 0x22,0x29,0x01, 0x22,0x2e,0x02, 0x22,0x33,0x00, 0x22,0x3f,0x03, 0x22,0x49,0x00, 0x22,0x56,0x01, 0x22,0x61,0x02, 0x22,0x6e,0x0a, 28 | 0x23,0x05,0x03, 0x23,0x1d,0x01, 0x23,0x23,0x01, 0x23,0x2a,0x01, 0x23,0x2e,0x03, 0x23,0x33,0x01, 0x23,0x3f,0x04, 0x23,0x48,0x01, 0x23,0x56,0x01, 0x23,0x62,0x11, 0x24,0x04,0x03, 0x24,0x1c,0x01, 0x24,0x23,0x01, 0x24,0x2b,0x01, 0x24,0x2e,0x00, 0x24,0x33,0x00, 29 | 0x24,0x40,0x03, 0x24,0x48,0x00, 0x24,0x56,0x01, 0x24,0x62,0x10, 0x25,0x04,0x03, 0x25,0x1b,0x01, 0x25,0x23,0x00, 0x25,0x2c,0x00, 0x25,0x30,0x03, 0x25,0x41,0x03, 0x25,0x47,0x01, 0x25,0x56,0x00, 0x25,0x64,0x01, 0x25,0x67,0x09, 0x26,0x03,0x03, 0x26,0x1b,0x00, 30 | 0x26,0x23,0x00, 0x26,0x2c,0x01, 0x26,0x2f,0x01, 0x26,0x42,0x05, 0x26,0x55,0x01, 0x26,0x67,0x04, 0x27,0x03,0x02, 0x27,0x1a,0x01, 0x27,0x23,0x00, 0x27,0x2d,0x02, 0x27,0x43,0x03, 0x27,0x55,0x01, 0x27,0x68,0x02, 0x28,0x02,0x03, 0x28,0x19,0x01, 0x28,0x22,0x01, 31 | 0x28,0x43,0x01, 0x28,0x54,0x01, 0x28,0x68,0x03, 0x29,0x02,0x02, 0x29,0x19,0x00, 0x29,0x22,0x00, 0x29,0x44,0x01, 0x29,0x53,0x01, 0x29,0x68,0x03, 0x2a,0x02,0x02, 0x2a,0x18,0x01, 0x2a,0x22,0x00, 0x2a,0x44,0x03, 0x2a,0x51,0x02, 0x2a,0x68,0x03, 0x2b,0x01,0x03, 32 | 0x2b,0x0e,0x02, 0x2b,0x17,0x01, 0x2b,0x21,0x00, 0x2b,0x45,0x0c, 0x2b,0x69,0x02, 0x2c,0x01,0x02, 0x2c,0x0b,0x01, 0x2c,0x13,0x00, 0x2c,0x17,0x00, 0x2c,0x21,0x00, 0x2c,0x45,0x01, 0x2c,0x4a,0x04, 0x2c,0x69,0x02, 0x2d,0x01,0x02, 0x2d,0x0a,0x00, 0x2d,0x14,0x00, 33 | 0x2d,0x16,0x01, 0x2d,0x21,0x00, 0x2d,0x2e,0x07, 0x2d,0x46,0x00, 0x2d,0x69,0x02, 0x2e,0x01,0x02, 0x2e,0x09,0x00, 0x2e,0x15,0x01, 0x2e,0x20,0x00, 0x2e,0x2e,0x08, 0x2e,0x46,0x00, 0x2e,0x53,0x01, 0x2e,0x69,0x02, 0x2f,0x00,0x03, 0x2f,0x08,0x00, 0x2f,0x15,0x01, 34 | 0x2f,0x20,0x00, 0x2f,0x2e,0x09, 0x2f,0x46,0x01, 0x2f,0x50,0x07, 0x2f,0x69,0x02, 0x30,0x00,0x02, 0x30,0x08,0x00, 0x30,0x15,0x00, 0x30,0x1f,0x00, 0x30,0x22,0x03, 0x30,0x2f,0x08, 0x30,0x46,0x01, 0x30,0x4f,0x01, 0x30,0x56,0x02, 0x30,0x69,0x02, 0x31,0x00,0x02, 35 | 0x31,0x15,0x00, 0x31,0x1f,0x00, 0x31,0x21,0x07, 0x31,0x2f,0x0a, 0x31,0x46,0x01, 0x31,0x4e,0x01, 0x31,0x58,0x01, 0x31,0x68,0x03, 0x32,0x00,0x02, 0x32,0x07,0x00, 0x32,0x14,0x00, 0x32,0x1e,0x00, 0x32,0x21,0x08, 0x32,0x30,0x12, 0x32,0x46,0x02, 0x32,0x4e,0x00, 36 | 0x32,0x58,0x01, 0x32,0x68,0x03, 0x33,0x00,0x03, 0x33,0x07,0x00, 0x33,0x14,0x00, 0x33,0x1e,0x00, 0x33,0x23,0x07, 0x33,0x30,0x0c, 0x33,0x42,0x01, 0x33,0x46,0x03, 0x33,0x4e,0x00, 0x33,0x59,0x01, 0x33,0x68,0x03, 0x34,0x01,0x02, 0x34,0x07,0x00, 0x34,0x13,0x01, 37 | 0x34,0x1d,0x00, 0x34,0x26,0x03, 0x34,0x31,0x0c, 0x34,0x43,0x00, 0x34,0x46,0x01, 0x34,0x49,0x02, 0x34,0x4d,0x01, 0x34,0x59,0x01, 0x34,0x68,0x03, 0x35,0x01,0x02, 0x35,0x07,0x00, 0x35,0x13,0x00, 0x35,0x1c,0x01, 0x35,0x31,0x0c, 0x35,0x43,0x00, 0x35,0x46,0x00, 38 | 0x35,0x4b,0x01, 0x35,0x4e,0x00, 0x35,0x59,0x01, 0x35,0x68,0x02, 0x36,0x01,0x02, 0x36,0x13,0x00, 0x36,0x1c,0x00, 0x36,0x31,0x0c, 0x36,0x42,0x01, 0x36,0x46,0x00, 0x36,0x4c,0x00, 0x36,0x4e,0x00, 0x36,0x59,0x00, 0x36,0x68,0x02, 0x37,0x01,0x03, 0x37,0x08,0x00, 39 | 0x37,0x12,0x01, 0x37,0x1b,0x01, 0x37,0x31,0x0e, 0x37,0x42,0x00, 0x37,0x45,0x01, 0x37,0x4b,0x01, 0x37,0x4e,0x00, 0x37,0x58,0x01, 0x37,0x67,0x03, 0x38,0x02,0x03, 0x38,0x12,0x00, 0x38,0x1b,0x00, 0x38,0x32,0x0b, 0x38,0x40,0x02, 0x38,0x45,0x01, 0x38,0x4b,0x01, 40 | 0x38,0x4f,0x00, 0x38,0x57,0x01, 0x38,0x67,0x03, 0x39,0x02,0x03, 0x39,0x09,0x00, 0x39,0x12,0x00, 0x39,0x1a,0x01, 0x39,0x32,0x0b, 0x39,0x3f,0x01, 0x39,0x44,0x02, 0x39,0x4b,0x00, 0x39,0x50,0x01, 0x39,0x56,0x01, 0x39,0x67,0x02, 0x3a,0x03,0x04, 0x3a,0x0a,0x01, 41 | 0x3a,0x12,0x00, 0x3a,0x1a,0x00, 0x3a,0x32,0x0d, 0x3a,0x44,0x03, 0x3a,0x4b,0x00, 0x3a,0x52,0x04, 0x3a,0x66,0x03, 0x3b,0x04,0x04, 0x3b,0x0c,0x01, 0x3b,0x11,0x00, 0x3b,0x19,0x00, 0x3b,0x32,0x0c, 0x3b,0x43,0x02, 0x3b,0x47,0x01, 0x3b,0x4b,0x00, 0x3b,0x66,0x02, 42 | 0x3c,0x05,0x05, 0x3c,0x11,0x00, 0x3c,0x19,0x00, 0x3c,0x33,0x0a, 0x3c,0x42,0x04, 0x3c,0x49,0x02, 0x3c,0x65,0x03, 0x3d,0x06,0x08, 0x3d,0x11,0x00, 0x3d,0x18,0x01, 0x3d,0x1d,0x06, 0x3d,0x25,0x00, 0x3d,0x33,0x0a, 0x3d,0x41,0x01, 0x3d,0x45,0x02, 0x3d,0x4a,0x01, 43 | 0x3d,0x64,0x04, 0x3e,0x08,0x09, 0x3e,0x18,0x01, 0x3e,0x1d,0x07, 0x3e,0x34,0x09, 0x3e,0x40,0x01, 0x3e,0x44,0x04, 0x3e,0x63,0x04, 0x3f,0x0a,0x07, 0x3f,0x17,0x03, 0x3f,0x1e,0x05, 0x3f,0x34,0x09, 0x3f,0x3f,0x01, 0x3f,0x43,0x06, 0x3f,0x63,0x03, 0x40,0x0d,0x04, 44 | 0x40,0x17,0x05, 0x40,0x20,0x03, 0x40,0x34,0x0b, 0x40,0x42,0x08, 0x40,0x61,0x05, 0x41,0x0c,0x04, 0x41,0x17,0x07, 0x41,0x22,0x00, 0x41,0x35,0x08, 0x41,0x41,0x04, 0x41,0x47,0x0a, 0x41,0x60,0x05, 0x42,0x0c,0x04, 0x42,0x16,0x0c, 0x42,0x35,0x07, 0x42,0x40,0x04, 45 | 0x42,0x48,0x04, 0x42,0x51,0x03, 0x42,0x5f,0x05, 0x43,0x0b,0x03, 0x43,0x10,0x00, 0x43,0x16,0x06, 0x43,0x1f,0x03, 0x43,0x35,0x07, 0x43,0x3f,0x04, 0x43,0x49,0x03, 0x43,0x53,0x02, 0x43,0x5c,0x07, 0x44,0x0b,0x02, 0x44,0x10,0x01, 0x44,0x16,0x06, 0x44,0x21,0x01, 46 | 0x44,0x35,0x06, 0x44,0x3e,0x04, 0x44,0x49,0x04, 0x44,0x55,0x01, 0x44,0x59,0x0b, 0x45,0x0a,0x03, 0x45,0x10,0x01, 0x45,0x16,0x05, 0x45,0x21,0x01, 0x45,0x35,0x0c, 0x45,0x49,0x05, 0x45,0x56,0x0f, 0x46,0x09,0x03, 0x46,0x10,0x01, 0x46,0x15,0x06, 0x46,0x21,0x01, 47 | 0x46,0x34,0x0b, 0x46,0x4a,0x08, 0x46,0x55,0x09, 0x46,0x62,0x03, 0x47,0x08,0x04, 0x47,0x10,0x01, 0x47,0x15,0x06, 0x47,0x21,0x01, 0x47,0x34,0x0a, 0x47,0x4b,0x11, 0x47,0x63,0x03, 0x48,0x07,0x05, 0x48,0x10,0x01, 0x48,0x15,0x05, 0x48,0x21,0x01, 0x48,0x34,0x08, 48 | 0x48,0x49,0x0e, 0x48,0x63,0x03, 0x49,0x07,0x03, 0x49,0x0c,0x00, 0x49,0x10,0x01, 0x49,0x15,0x05, 0x49,0x21,0x01, 0x49,0x33,0x08, 0x49,0x48,0x06, 0x49,0x52,0x03, 0x49,0x64,0x03, 0x4a,0x07,0x02, 0x4a,0x0c,0x01, 0x4a,0x10,0x01, 0x4a,0x15,0x04, 0x4a,0x22,0x01, 49 | 0x4a,0x33,0x06, 0x4a,0x47,0x05, 0x4a,0x64,0x03, 0x4b,0x07,0x02, 0x4b,0x0d,0x00, 0x4b,0x11,0x01, 0x4b,0x15,0x04, 0x4b,0x22,0x02, 0x4b,0x32,0x05, 0x4b,0x47,0x03, 0x4b,0x64,0x03, 0x4c,0x07,0x02, 0x4c,0x0d,0x01, 0x4c,0x11,0x01, 0x4c,0x15,0x03, 0x4c,0x23,0x02, 50 | 0x4c,0x31,0x04, 0x4c,0x46,0x03, 0x4c,0x64,0x03, 0x4d,0x07,0x03, 0x4d,0x0e,0x01, 0x4d,0x11,0x07, 0x4d,0x23,0x03, 0x4d,0x30,0x04, 0x4d,0x46,0x03, 0x4d,0x64,0x03, 0x4e,0x07,0x03, 0x4e,0x0f,0x08, 0x4e,0x20,0x00, 0x4e,0x25,0x05, 0x4e,0x2c,0x07, 0x4e,0x46,0x02, 51 | 0x4e,0x64,0x03, 0x4f,0x08,0x03, 0x4f,0x13,0x04, 0x4f,0x20,0x00, 0x4f,0x25,0x0d, 0x4f,0x45,0x03, 0x4f,0x63,0x04, 0x50,0x09,0x02, 0x50,0x17,0x00, 0x50,0x25,0x0a, 0x50,0x45,0x03, 0x50,0x62,0x06, 0x51,0x0a,0x02, 0x51,0x17,0x01, 0x51,0x20,0x00, 0x51,0x25,0x04, 52 | 0x51,0x45,0x03, 0x51,0x61,0x01, 0x51,0x65,0x03, 0x52,0x0a,0x02, 0x52,0x17,0x01, 0x52,0x20,0x00, 0x52,0x24,0x04, 0x52,0x46,0x02, 0x52,0x5f,0x02, 0x52,0x65,0x03, 0x53,0x0a,0x02, 0x53,0x18,0x00, 0x53,0x20,0x00, 0x53,0x23,0x04, 0x53,0x46,0x03, 0x53,0x5d,0x02, 53 | 0x53,0x64,0x04, 0x54,0x0a,0x03, 0x54,0x1f,0x08, 0x54,0x46,0x03, 0x54,0x5b,0x01, 0x54,0x62,0x05, 0x55,0x0a,0x03, 0x55,0x1f,0x07, 0x55,0x46,0x03, 0x55,0x59,0x01, 0x55,0x5f,0x08, 0x56,0x0b,0x03, 0x56,0x1d,0x07, 0x56,0x47,0x03, 0x56,0x57,0x01, 0x56,0x5d,0x08, 54 | 0x57,0x0b,0x04, 0x57,0x1c,0x05, 0x57,0x47,0x05, 0x57,0x53,0x03, 0x57,0x5c,0x07, 0x58,0x0c,0x04, 0x58,0x1a,0x06, 0x58,0x48,0x0b, 0x58,0x5a,0x07, 0x59,0x0d,0x07, 0x59,0x16,0x08, 0x59,0x49,0x06, 0x59,0x58,0x06, 0x5a,0x0e,0x0f, 0x5a,0x4a,0x03, 0x5a,0x56,0x07, 55 | 0x5b,0x10,0x0b, 0x5b,0x4b,0x04, 0x5b,0x53,0x09, 0x5c,0x12,0x06, 0x5c,0x4b,0x0f, 0x5d,0x4c,0x0c, 0x5e,0x4d,0x08, 56 | }; 57 | 58 | const unsigned short fontmario0_CharOffs[2] PROGMEM = { 59 | 0x0000, 0x0287, 60 | }; 61 | 62 | RRE_Font rre_mario0 = { RRE_V24B, 96,128, 0x20, 0x20, (const uint8_t*)fontmario0_Rects, (const uint16_t*)fontmario0_CharOffs }; 63 | 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario1.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario1_h__ 2 | #define __font_mario1_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario1] 48x64 7 | Total chars: 4 (' ' to '#') 8 | Total rects: 322 * 3 bytes 9 | Total pixels: 4743 (95 overlapping) 10 | Total bytes: 974 (966 rects + 8 offs) 11 | Bitmap size: 1536 (48x64 * 4) (+4 opt) 12 | */ 13 | 14 | const unsigned char fontmario1_Rects[966] PROGMEM = { 15 | 0xc0,0xc0,0x51, 0xc0,0xe0,0x48, 0x92,0x80,0x0a, 0x09,0xf3,0x03, 0x92,0x4b,0x05, 0xdd,0x00,0x08, 0x52,0x52,0x02, 0x9d,0x04,0x03, 0x89,0x20,0x03, 0x0d,0x7b,0x01, 0x66,0x00,0x03, 0xd8,0x0b,0x01, 0x52,0x58,0x00, 0x89,0x23,0x01, 0x49,0x6d,0x00, 0x5d,0x07,0x01, 16 | 0xec,0x0e,0x00, 0x4f,0x3e,0x01, 0x2a,0x00,0x02, 0x21,0x04,0x02, 0x95,0x12,0x00, 0x0d,0x20,0x02, 0x89,0x26,0x00, 0xa8,0x2d,0x00, 0x8a,0x30,0x00, 0x17,0x3a,0x02, 0x1a,0x0b,0x01, 0x53,0x18,0x00, 0x4d,0x39,0x00, 0x1c,0x3d,0x01, 0x11,0x3f,0x01, 0x26,0x02,0x00, 17 | 0x21,0x05,0x00, 0x1f,0x07,0x00, 0x1d,0x09,0x00, 0x2e,0x0a,0x00, 0x2d,0x0b,0x00, 0x1a,0x0c,0x00, 0x18,0x0f,0x00, 0x16,0x12,0x00, 0x2d,0x13,0x00, 0x0d,0x21,0x00, 0x2e,0x21,0x00, 0x2c,0x22,0x00, 0x0b,0x23,0x00, 0x26,0x24,0x00, 0x21,0x25,0x00, 0x22,0x27,0x00, 18 | 0x23,0x29,0x00, 0x26,0x2b,0x00, 0x12,0x2e,0x00, 0x2c,0x2e,0x00, 0x11,0x2f,0x00, 0x19,0x31,0x00, 0x1e,0x31,0x00, 0x0b,0x32,0x00, 0x20,0x33,0x00, 0x18,0x34,0x00, 0x1c,0x34,0x00, 0x2c,0x34,0x00, 0x2d,0x36,0x00, 0x2e,0x37,0x00, 0x1c,0x38,0x00, 0x18,0x39,0x00, 19 | 0x1b,0x39,0x00, 0x20,0x3c,0x00, 0x0f,0x3d,0x00, 0x18,0x3d,0x00, 0x2f,0x09,0x00, 0x4d,0x40,0x22, 0xad,0x06,0x82, 0x9d,0xb5,0x04, 0xa7,0x62,0x05, 0xa1,0x06,0x0b, 0x8f,0x06,0x06, 0xe9,0x09,0x03, 0xd9,0x3c,0x03, 0x6b,0x5c,0x01, 0x61,0xab,0x00, 0x8a,0x00,0x02, 20 | 0x50,0x09,0x03, 0x66,0x09,0x02, 0x9b,0x39,0x01, 0x0e,0x06,0x0c, 0x1f,0x21,0x04, 0x06,0x00,0x03, 0x1d,0x06,0x03, 0x6b,0x0d,0x01, 0x14,0x0f,0x03, 0xea,0x1e,0x00, 0x65,0x27,0x01, 0xe0,0x31,0x00, 0x1a,0x0a,0x02, 0x9f,0x10,0x00, 0xa0,0x13,0x00, 0x15,0x20,0x02, 21 | 0x0b,0x03,0x01, 0x16,0x07,0x01, 0x01,0x08,0x01, 0x24,0x09,0x01, 0x10,0x0b,0x01, 0x6c,0x0f,0x00, 0x02,0x13,0x01, 0x6c,0x1a,0x00, 0x0d,0x1c,0x01, 0x15,0x1c,0x01, 0x0f,0x1d,0x01, 0x5d,0x1f,0x00, 0x00,0x20,0x01, 0x69,0x20,0x00, 0x4c,0x21,0x00, 0x5f,0x33,0x00, 22 | 0x5c,0x37,0x00, 0x58,0x3e,0x00, 0x09,0x01,0x00, 0x0c,0x04,0x00, 0x20,0x07,0x00, 0x05,0x08,0x00, 0x14,0x09,0x00, 0x19,0x0b,0x00, 0x28,0x0b,0x00, 0x0a,0x0c,0x00, 0x10,0x0c,0x00, 0x1c,0x0c,0x00, 0x1f,0x0c,0x00, 0x18,0x0d,0x00, 0x23,0x0d,0x00, 0x2a,0x0d,0x00, 23 | 0x14,0x0e,0x00, 0x1b,0x0e,0x00, 0x25,0x0e,0x00, 0x1c,0x0f,0x00, 0x1b,0x10,0x00, 0x27,0x10,0x00, 0x09,0x11,0x00, 0x06,0x12,0x00, 0x28,0x12,0x00, 0x00,0x14,0x00, 0x26,0x17,0x00, 0x28,0x18,0x00, 0x1c,0x19,0x00, 0x0c,0x1a,0x00, 0x0e,0x1a,0x00, 0x0a,0x1b,0x00, 24 | 0x19,0x1b,0x00, 0x27,0x1b,0x00, 0x08,0x1c,0x00, 0x06,0x1d,0x00, 0x0c,0x1d,0x00, 0x04,0x1e,0x00, 0x02,0x1f,0x00, 0x23,0x1f,0x00, 0x11,0x21,0x00, 0x1b,0x21,0x00, 0x28,0x21,0x00, 0x23,0x22,0x00, 0x13,0x23,0x00, 0x18,0x23,0x00, 0x21,0x24,0x00, 0x0c,0x25,0x00, 25 | 0x1c,0x26,0x00, 0x26,0x26,0x00, 0x00,0x27,0x00, 0x0b,0x27,0x00, 0x1d,0x28,0x00, 0x24,0x28,0x00, 0x00,0x2e,0x00, 0x05,0x30,0x00, 0x1c,0x30,0x00, 0x1e,0x34,0x00, 0x00,0x38,0x00, 0x1a,0x3b,0x00, 0x17,0x3f,0x00, 0xa2,0x69,0x4d, 0x40,0xa6,0x49, 0x80,0x40,0x0e, 26 | 0xa3,0xb5,0x03, 0x40,0x47,0x06, 0xcf,0x00,0x04, 0x40,0x60,0x02, 0x8a,0x3d,0x05, 0x80,0x0d,0x03, 0x9f,0x3d,0x03, 0x43,0x24,0x03, 0x8a,0x66,0x00, 0xa6,0x6e,0x00, 0x07,0x07,0x05, 0x80,0x10,0x01, 0x8a,0x3a,0x01, 0x00,0x5b,0x00, 0x54,0x01,0x01, 0x61,0x3b,0x01, 27 | 0x50,0x3e,0x01, 0x1b,0x3f,0x03, 0x0f,0x04,0x02, 0x0a,0x0d,0x02, 0x80,0x13,0x00, 0x9b,0x18,0x00, 0x16,0x1e,0x02, 0x8b,0x27,0x00, 0xa5,0x32,0x00, 0x07,0x08,0x01, 0x12,0x0b,0x01, 0x04,0x0d,0x01, 0x17,0x11,0x01, 0x4f,0x18,0x00, 0x41,0x1e,0x00, 0x43,0x22,0x00, 28 | 0x4d,0x2e,0x00, 0x4f,0x2e,0x00, 0x4c,0x3b,0x00, 0x12,0x3f,0x01, 0x14,0x00,0x00, 0x16,0x01,0x00, 0x26,0x01,0x00, 0x0f,0x05,0x00, 0x2f,0x05,0x00, 0x07,0x09,0x00, 0x0b,0x0b,0x00, 0x0a,0x0c,0x00, 0x15,0x0c,0x00, 0x17,0x0d,0x00, 0x04,0x0e,0x00, 0x0c,0x0e,0x00, 29 | 0x18,0x0e,0x00, 0x09,0x0f,0x00, 0x02,0x10,0x00, 0x07,0x10,0x00, 0x06,0x11,0x00, 0x05,0x12,0x00, 0x04,0x14,0x00, 0x08,0x14,0x00, 0x0a,0x15,0x00, 0x0e,0x15,0x00, 0x1a,0x15,0x00, 0x09,0x18,0x00, 0x0c,0x18,0x00, 0x0d,0x1b,0x00, 0x16,0x1b,0x00, 0x04,0x1d,0x00, 30 | 0x13,0x1e,0x00, 0x08,0x21,0x00, 0x14,0x21,0x00, 0x16,0x21,0x00, 0x0a,0x22,0x00, 0x15,0x22,0x00, 0x04,0x23,0x00, 0x0d,0x23,0x00, 0x13,0x23,0x00, 0x07,0x25,0x00, 0x10,0x26,0x00, 0x0f,0x29,0x00, 0x10,0x2a,0x00, 0x0e,0x2b,0x00, 0x24,0x34,0x00, 0x0d,0x37,0x00, 31 | 0x0a,0x39,0x00, 0x22,0x3a,0x00, 0x0d,0x3c,0x00, 0x1e,0x3e,0x00, 0xe7,0x2c,0x48, 0x17,0x40,0x18, 0x8c,0x29,0x23, 0x29,0xa0,0x06, 0x2a,0x45,0x05, 0x13,0x44,0x05, 0x2e,0x97,0x01, 0x0e,0x28,0x11, 0x51,0x26,0x04, 0xab,0x1d,0x02, 0xe7,0x25,0x01, 0x15,0x42,0x05, 32 | 0x24,0x05,0x05, 0x6d,0x0a,0x02, 0x07,0x2b,0x04, 0x44,0x04,0x01, 0xef,0x13,0x00, 0x92,0x05,0x07, 0x27,0x06,0x02, 0xaf,0x0c,0x00, 0x92,0x0d,0x00, 0xad,0x1a,0x00, 0x12,0x25,0x02, 0x10,0x27,0x07, 0x16,0x81,0x01, 0x94,0x03,0x08, 0x41,0x00,0x00, 0x6a,0x14,0x00, 33 | 0x64,0x1d,0x00, 0x61,0x23,0x00, 0x68,0x23,0x00, 0x66,0x27,0x00, 0x0a,0x2a,0x01, 0x02,0x03,0x00, 0x0a,0x03,0x00, 0x08,0x04,0x00, 0x11,0x06,0x00, 0x29,0x07,0x00, 0x2c,0x0a,0x00, 0x2e,0x0c,0x00, 0x02,0x0f,0x00, 0x01,0x10,0x00, 0x00,0x12,0x00, 0x13,0x12,0x00, 34 | 0x29,0x12,0x00, 0x28,0x15,0x00, 0x29,0x17,0x00, 0x03,0x18,0x00, 0x28,0x19,0x00, 0x26,0x1a,0x00, 0x27,0x1b,0x00, 0x26,0x1c,0x00, 0x2c,0x1c,0x00, 0x25,0x1e,0x00, 0x2a,0x1f,0x00, 0x23,0x20,0x00, 0x24,0x21,0x00, 0x23,0x23,0x00, 0x13,0x24,0x00, 0x22,0x24,0x00, 35 | 0x25,0x28,0x00, 0xc0,0x2c,0x6f, 36 | }; 37 | 38 | const unsigned short fontmario1_CharOffs[5] PROGMEM = { 39 | 0x0000, 0x0045, 0x00ae, 0x0105, 0x0142, 40 | }; 41 | 42 | RRE_Font rre_mario1 = { RRE_24B, 48,64, 0x20, 0x23, (const uint8_t*)fontmario1_Rects, (const uint16_t*)fontmario1_CharOffs }; 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario2.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario2_h__ 2 | #define __font_mario2_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario2] 48x64 7 | Total chars: 4 (' ' to '#') 8 | Total rects: 421 * 3 bytes 9 | Total pixels: 2237 (982 overlapping) 10 | Total bytes: 1271 (1263 rects + 8 offs) 11 | Bitmap size: 1536 (48x64 * 4) (+4 opt) 12 | */ 13 | 14 | const unsigned char fontmario2_Rects[1263] PROGMEM = { 15 | 0x9e,0x68,0x02, 0x5d,0x67,0x02, 0xa1,0x2b,0x01, 0x2c,0x6f,0x00, 0xc9,0x29,0x00, 0x16,0x2c,0x03, 0xe4,0x2f,0x00, 0x5b,0x36,0x01, 0x23,0x2d,0x02, 0x8f,0x33,0x00, 0x9f,0xa5,0x00, 0x2d,0x00,0x01, 0x2b,0x0d,0x01, 0x6b,0x11,0x00, 0x53,0x1a,0x00, 0x54,0x23,0x00, 16 | 0x5c,0x29,0x00, 0x2d,0x2d,0x01, 0x25,0x2e,0x01, 0x60,0x2f,0x00, 0x61,0x30,0x00, 0x58,0x31,0x00, 0x62,0x31,0x00, 0x66,0x31,0x00, 0x59,0x33,0x00, 0x16,0x3d,0x01, 0x21,0x6a,0x00, 0x2a,0x01,0x00, 0x27,0x02,0x00, 0x2c,0x04,0x00, 0x22,0x05,0x00, 0x29,0x05,0x00, 17 | 0x21,0x06,0x00, 0x27,0x06,0x00, 0x24,0x08,0x00, 0x23,0x09,0x00, 0x1a,0x0d,0x00, 0x1f,0x0d,0x00, 0x1e,0x0e,0x00, 0x18,0x10,0x00, 0x1c,0x11,0x00, 0x1b,0x12,0x00, 0x2c,0x12,0x00, 0x16,0x13,0x00, 0x1a,0x14,0x00, 0x2c,0x14,0x00, 0x15,0x15,0x00, 0x2d,0x15,0x00, 18 | 0x19,0x16,0x00, 0x2c,0x16,0x00, 0x2e,0x17,0x00, 0x14,0x18,0x00, 0x18,0x18,0x00, 0x29,0x18,0x00, 0x2c,0x18,0x00, 0x27,0x19,0x00, 0x17,0x1a,0x00, 0x26,0x1a,0x00, 0x29,0x1a,0x00, 0x26,0x1c,0x00, 0x16,0x1d,0x00, 0x25,0x1d,0x00, 0x12,0x1e,0x00, 0x24,0x1e,0x00, 19 | 0x23,0x1f,0x00, 0x10,0x20,0x00, 0x15,0x20,0x00, 0x22,0x20,0x00, 0x2d,0x20,0x00, 0x0e,0x21,0x00, 0x21,0x21,0x00, 0x2a,0x21,0x00, 0x0d,0x22,0x00, 0x1e,0x22,0x00, 0x20,0x22,0x00, 0x27,0x22,0x00, 0x2b,0x22,0x00, 0x12,0x23,0x00, 0x1d,0x23,0x00, 0x29,0x23,0x00, 20 | 0x0b,0x24,0x00, 0x10,0x24,0x00, 0x25,0x24,0x00, 0x1c,0x25,0x00, 0x0a,0x26,0x00, 0x1e,0x26,0x00, 0x0d,0x27,0x00, 0x22,0x28,0x00, 0x12,0x2b,0x00, 0x25,0x2b,0x00, 0x23,0x2c,0x00, 0x27,0x2c,0x00, 0x0d,0x2d,0x00, 0x13,0x2d,0x00, 0x1b,0x2d,0x00, 0x0f,0x2e,0x00, 21 | 0x1c,0x2e,0x00, 0x0a,0x2f,0x00, 0x0e,0x2f,0x00, 0x25,0x2f,0x00, 0x10,0x30,0x00, 0x27,0x30,0x00, 0x0b,0x31,0x00, 0x16,0x31,0x00, 0x0c,0x32,0x00, 0x1a,0x32,0x00, 0x1f,0x32,0x00, 0x23,0x32,0x00, 0x1b,0x33,0x00, 0x22,0x34,0x00, 0x24,0x34,0x00, 0x1c,0x35,0x00, 22 | 0x0d,0x38,0x00, 0x10,0x38,0x00, 0x19,0x39,0x00, 0x0f,0x3c,0x00, 0x14,0x3c,0x00, 0x10,0x3d,0x00, 0x1e,0x3d,0x00, 0x21,0x3d,0x00, 0x11,0x3e,0x00, 0x22,0x3e,0x00, 0x1f,0x3f,0x00, 0x2f,0x1f,0x00, 0x8b,0x0e,0x01, 0x41,0x7a,0x00, 0x11,0x34,0x04, 0x19,0x14,0x03, 23 | 0x0c,0x3e,0x03, 0x00,0x03,0x02, 0x21,0x09,0x02, 0x11,0x11,0x02, 0x23,0x17,0x02, 0x8c,0x1e,0x00, 0x08,0x31,0x02, 0x04,0x00,0x01, 0x1b,0x06,0x01, 0x00,0x07,0x01, 0x46,0x07,0x00, 0x48,0x08,0x00, 0x0b,0x0b,0x01, 0x16,0x0d,0x01, 0x4d,0x0f,0x00, 0x0b,0x12,0x01, 24 | 0x19,0x12,0x01, 0x14,0x15,0x01, 0x53,0x1d,0x00, 0x10,0x1f,0x01, 0x11,0x23,0x01, 0x44,0x24,0x00, 0x54,0x3c,0x00, 0x08,0x3e,0x01, 0x08,0x01,0x00, 0x06,0x04,0x00, 0x09,0x06,0x00, 0x0e,0x07,0x00, 0x1f,0x07,0x00, 0x16,0x08,0x00, 0x20,0x08,0x00, 0x0b,0x09,0x00, 25 | 0x0f,0x09,0x00, 0x15,0x09,0x00, 0x09,0x0a,0x00, 0x14,0x0a,0x00, 0x12,0x0b,0x00, 0x1e,0x0b,0x00, 0x1b,0x0c,0x00, 0x20,0x0c,0x00, 0x19,0x0d,0x00, 0x1d,0x0d,0x00, 0x1e,0x0e,0x00, 0x13,0x0f,0x00, 0x2b,0x0f,0x00, 0x1d,0x10,0x00, 0x0a,0x11,0x00, 0x28,0x11,0x00, 26 | 0x08,0x13,0x00, 0x1c,0x13,0x00, 0x01,0x14,0x00, 0x05,0x14,0x00, 0x02,0x15,0x00, 0x29,0x15,0x00, 0x00,0x16,0x00, 0x11,0x16,0x00, 0x20,0x16,0x00, 0x0e,0x17,0x00, 0x0c,0x18,0x00, 0x20,0x18,0x00, 0x24,0x18,0x00, 0x0a,0x19,0x00, 0x28,0x19,0x00, 0x2c,0x19,0x00, 27 | 0x08,0x1a,0x00, 0x0b,0x1a,0x00, 0x1a,0x1a,0x00, 0x06,0x1b,0x00, 0x0f,0x1b,0x00, 0x18,0x1b,0x00, 0x03,0x1d,0x00, 0x01,0x1e,0x00, 0x25,0x1e,0x00, 0x29,0x1f,0x00, 0x14,0x20,0x00, 0x20,0x20,0x00, 0x00,0x21,0x00, 0x1a,0x21,0x00, 0x03,0x22,0x00, 0x1c,0x22,0x00, 28 | 0x19,0x23,0x00, 0x0d,0x24,0x00, 0x0f,0x24,0x00, 0x1e,0x24,0x00, 0x26,0x25,0x00, 0x00,0x26,0x00, 0x0c,0x26,0x00, 0x1d,0x27,0x00, 0x23,0x28,0x00, 0x01,0x29,0x00, 0x02,0x2a,0x00, 0x04,0x2a,0x00, 0x21,0x2a,0x00, 0x1e,0x2b,0x00, 0x02,0x2f,0x00, 0x1d,0x2f,0x00, 29 | 0x04,0x30,0x00, 0x20,0x30,0x00, 0x0c,0x32,0x00, 0x1a,0x32,0x00, 0x0e,0x33,0x00, 0x18,0x33,0x00, 0x1c,0x36,0x00, 0x1b,0x38,0x00, 0x1a,0x3a,0x00, 0x03,0x3d,0x00, 0x12,0x3d,0x00, 0x18,0x3d,0x00, 0x06,0x3e,0x00, 0x11,0x3e,0x00, 0x13,0x3e,0x00, 0x08,0x3f,0x00, 30 | 0x2c,0x11,0x00, 0xd3,0x26,0x4a, 0x9f,0xa6,0x02, 0x51,0xaf,0x0d, 0x19,0x61,0x04, 0x92,0x28,0x4a, 0x60,0xa4,0x02, 0x95,0x65,0x46, 0x1c,0x03,0x06, 0x03,0x56,0x00, 0x1f,0x71,0x00, 0x1a,0x20,0x02, 0x9e,0x21,0x00, 0x8f,0x30,0x00, 0x11,0xed,0x00, 0x6a,0x0f,0x00, 31 | 0x18,0x12,0x01, 0x5c,0x12,0x00, 0x09,0x13,0x01, 0x40,0x16,0x00, 0x4c,0x19,0x00, 0x58,0x23,0x00, 0x51,0x26,0x00, 0x4f,0x27,0x00, 0x66,0x2c,0x00, 0x13,0x3b,0x01, 0x17,0x01,0x00, 0x27,0x02,0x00, 0x29,0x03,0x00, 0x12,0x04,0x00, 0x19,0x04,0x00, 0x2b,0x04,0x00, 32 | 0x10,0x05,0x00, 0x16,0x05,0x00, 0x28,0x05,0x00, 0x29,0x06,0x00, 0x0d,0x07,0x00, 0x13,0x07,0x00, 0x24,0x07,0x00, 0x27,0x07,0x00, 0x09,0x08,0x00, 0x22,0x08,0x00, 0x26,0x08,0x00, 0x2a,0x08,0x00, 0x08,0x09,0x00, 0x13,0x09,0x00, 0x20,0x09,0x00, 0x24,0x09,0x00, 33 | 0x07,0x0a,0x00, 0x1e,0x0a,0x00, 0x22,0x0a,0x00, 0x17,0x0b,0x00, 0x20,0x0b,0x00, 0x1b,0x0c,0x00, 0x06,0x0d,0x00, 0x1a,0x0d,0x00, 0x0b,0x0e,0x00, 0x1e,0x0e,0x00, 0x08,0x0f,0x00, 0x19,0x0f,0x00, 0x1d,0x10,0x00, 0x02,0x11,0x00, 0x29,0x12,0x00, 0x01,0x13,0x00, 34 | 0x04,0x13,0x00, 0x19,0x13,0x00, 0x28,0x13,0x00, 0x0a,0x14,0x00, 0x1d,0x14,0x00, 0x27,0x14,0x00, 0x1f,0x15,0x00, 0x25,0x15,0x00, 0x07,0x16,0x00, 0x0d,0x17,0x00, 0x0f,0x17,0x00, 0x1b,0x17,0x00, 0x00,0x1a,0x00, 0x0e,0x1a,0x00, 0x1b,0x1b,0x00, 0x1a,0x1d,0x00, 35 | 0x19,0x1e,0x00, 0x15,0x20,0x00, 0x03,0x21,0x00, 0x13,0x21,0x00, 0x1f,0x22,0x00, 0x05,0x23,0x00, 0x0c,0x23,0x00, 0x14,0x23,0x00, 0x17,0x24,0x00, 0x08,0x25,0x00, 0x0b,0x26,0x00, 0x0c,0x27,0x00, 0x0b,0x2a,0x00, 0x10,0x2b,0x00, 0x27,0x2b,0x00, 0x0a,0x2d,0x00, 36 | 0x20,0x31,0x00, 0x25,0x31,0x00, 0x24,0x33,0x00, 0x23,0x34,0x00, 0x0a,0x38,0x00, 0x22,0x39,0x00, 0x0e,0x3c,0x00, 0x20,0x3c,0x00, 0x10,0x3d,0x00, 0x1d,0x3e,0x00, 0x14,0x3f,0x00, 0x1a,0x3f,0x00, 0x2d,0x05,0x01, 0x5b,0x0b,0x48, 0x98,0x98,0x07, 0x5a,0x8d,0x0c, 37 | 0x9c,0xca,0x09, 0xd7,0x1d,0x0a, 0x59,0xd6,0x05, 0x5e,0x49,0x44, 0x67,0x4d,0x00, 0x96,0x1f,0x0a, 0xc9,0x12,0x00, 0x99,0x0f,0x00, 0xab,0x10,0x00, 0x43,0x00,0x00, 0x47,0x00,0x00, 0x04,0x02,0x01, 0x4d,0x03,0x00, 0x1d,0x05,0x01, 0x22,0x05,0x01, 0x05,0x07,0x01, 38 | 0x4b,0x09,0x00, 0x66,0x0b,0x00, 0x69,0x10,0x00, 0x56,0x13,0x00, 0x64,0x19,0x00, 0x05,0x2b,0x01, 0x0a,0x00,0x00, 0x16,0x00,0x00, 0x09,0x01,0x00, 0x0e,0x02,0x00, 0x07,0x03,0x00, 0x06,0x05,0x00, 0x1b,0x06,0x00, 0x26,0x06,0x00, 0x09,0x07,0x00, 0x28,0x07,0x00, 39 | 0x0a,0x08,0x00, 0x29,0x08,0x00, 0x05,0x0a,0x00, 0x17,0x0a,0x00, 0x2b,0x0a,0x00, 0x06,0x0b,0x00, 0x2a,0x0e,0x00, 0x07,0x0f,0x00, 0x15,0x0f,0x00, 0x08,0x10,0x00, 0x12,0x10,0x00, 0x00,0x11,0x00, 0x14,0x14,0x00, 0x28,0x14,0x00, 0x00,0x15,0x00, 0x15,0x15,0x00, 40 | 0x2e,0x16,0x00, 0x01,0x17,0x00, 0x27,0x17,0x00, 0x06,0x18,0x00, 0x26,0x19,0x00, 0x2d,0x19,0x00, 0x25,0x1b,0x00, 0x2c,0x1b,0x00, 0x2a,0x1e,0x00, 0x29,0x1f,0x00, 0x17,0x22,0x00, 0x28,0x22,0x00, 0x27,0x24,0x00, 0x16,0x26,0x00, 0x26,0x26,0x00, 0x0f,0x27,0x00, 41 | 0x18,0x27,0x00, 0x24,0x28,0x00, 0x0b,0x29,0x00, 0x09,0x2a,0x00, 0xef,0x0f,0x00, 42 | }; 43 | 44 | const unsigned short fontmario2_CharOffs[5] PROGMEM = { 45 | 0x0000, 0x007c, 0x00f1, 0x015d, 0x01a5, 46 | }; 47 | 48 | RRE_Font rre_mario2 = { RRE_24B, 48,64, 0x20, 0x23, (const uint8_t*)fontmario2_Rects, (const uint16_t*)fontmario2_CharOffs }; 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario2_v.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario2_h__ 2 | #define __font_mario2_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario2] 96x128 7 | Total chars: 1 (' ' to ' ') 8 | Total rects: 478 * 3 bytes 9 | Total pixels: 1255 (1 overlapping) 10 | Total bytes: 1436 (1434 rects + 2 offs) 11 | Bitmap size: 1536 (96x128 * 1) (+1 opt) 12 | */ 13 | 14 | const unsigned char fontmario2_Rects[1434] PROGMEM = { 15 | 0x00,0x56,0x01, 0x00,0x5a,0x00, 0x01,0x53,0x00, 0x02,0x51,0x00, 0x03,0x56,0x04, 0x03,0x61,0x00, 0x04,0x53,0x00, 0x05,0x63,0x00, 0x06,0x4d,0x00, 0x07,0x4a,0x00, 0x07,0x56,0x00, 0x08,0x49,0x00, 0x08,0x4f,0x00, 0x08,0x65,0x00, 0x09,0x29,0x03, 0x09,0x48,0x00, 16 | 0x09,0x53,0x00, 0x0a,0x26,0x00, 0x0a,0x2f,0x00, 0x0a,0x53,0x01, 0x0a,0x6d,0x00, 0x0a,0x78,0x00, 0x0b,0x24,0x00, 0x0b,0x31,0x00, 0x0b,0x4e,0x00, 0x0b,0x66,0x00, 0x0b,0x6a,0x00, 0x0c,0x32,0x00, 0x0c,0x59,0x01, 0x0c,0x63,0x00, 0x0c,0x67,0x00, 0x0d,0x22,0x00, 17 | 0x0d,0x27,0x00, 0x0d,0x2d,0x00, 0x0d,0x38,0x00, 0x0d,0x47,0x00, 0x0d,0x57,0x00, 0x0e,0x21,0x00, 0x0e,0x2f,0x00, 0x0e,0x5a,0x00, 0x0e,0x7c,0x00, 0x0f,0x2e,0x00, 0x0f,0x33,0x02, 0x0f,0x3c,0x00, 0x0f,0x57,0x00, 0x0f,0x67,0x01, 0x0f,0x70,0x02, 0x10,0x20,0x00, 18 | 0x10,0x24,0x00, 0x10,0x30,0x00, 0x10,0x38,0x00, 0x10,0x3d,0x00, 0x10,0x45,0x00, 0x10,0x6b,0x00, 0x10,0x7d,0x00, 0x11,0x3e,0x00, 0x11,0x66,0x01, 0x11,0x6d,0x0c, 0x12,0x1e,0x00, 0x12,0x23,0x00, 0x12,0x2b,0x00, 0x12,0x44,0x00, 0x12,0x68,0x12, 0x13,0x1a,0x01, 19 | 0x13,0x2d,0x00, 0x13,0x47,0x00, 0x13,0x49,0x00, 0x13,0x61,0x00, 0x13,0x66,0x15, 0x14,0x18,0x00, 0x14,0x23,0x01, 0x14,0x3c,0x00, 0x14,0x63,0x00, 0x14,0x66,0x15, 0x14,0x7f,0x00, 0x15,0x15,0x00, 0x15,0x20,0x00, 0x15,0x60,0x00, 0x15,0x65,0x16, 0x16,0x13,0x00, 20 | 0x16,0x1d,0x00, 0x16,0x2c,0x00, 0x16,0x31,0x00, 0x16,0x3d,0x00, 0x16,0x45,0x00, 0x16,0x65,0x16, 0x17,0x1a,0x00, 0x17,0x2c,0x00, 0x17,0x3d,0x00, 0x17,0x41,0x00, 0x17,0x4b,0x00, 0x17,0x64,0x17, 0x18,0x10,0x00, 0x18,0x18,0x00, 0x18,0x2c,0x00, 0x18,0x31,0x01, 21 | 0x18,0x52,0x00, 0x18,0x63,0x18, 0x19,0x16,0x00, 0x19,0x2c,0x00, 0x19,0x33,0x01, 0x19,0x39,0x00, 0x19,0x44,0x00, 0x19,0x4f,0x00, 0x19,0x52,0x01, 0x19,0x5e,0x00, 0x19,0x61,0x1a, 0x1a,0x0d,0x00, 0x1a,0x14,0x00, 0x1a,0x32,0x00, 0x1a,0x4d,0x00, 0x1a,0x5d,0x00, 22 | 0x1a,0x60,0x1b, 0x1a,0x7f,0x00, 0x1b,0x12,0x00, 0x1b,0x2d,0x00, 0x1b,0x33,0x00, 0x1b,0x36,0x01, 0x1b,0x4c,0x00, 0x1b,0x57,0x00, 0x1b,0x5b,0x00, 0x1b,0x60,0x1b, 0x1c,0x11,0x00, 0x1c,0x25,0x00, 0x1c,0x29,0x01, 0x1c,0x2e,0x00, 0x1c,0x35,0x02, 0x1c,0x43,0x00, 23 | 0x1c,0x52,0x01, 0x1c,0x60,0x1a, 0x1d,0x23,0x00, 0x1d,0x27,0x05, 0x1d,0x43,0x00, 0x1d,0x50,0x00, 0x1d,0x54,0x00, 0x1d,0x61,0x18, 0x1d,0x7e,0x00, 0x1e,0x0e,0x00, 0x1e,0x22,0x00, 0x1e,0x26,0x08, 0x1e,0x3d,0x00, 0x1e,0x43,0x00, 0x1e,0x4a,0x00, 0x1e,0x4e,0x00, 24 | 0x1e,0x61,0x02, 0x1e,0x6f,0x09, 0x1f,0x0d,0x00, 0x1f,0x25,0x0a, 0x1f,0x32,0x00, 0x1f,0x3f,0x00, 0x1f,0x43,0x00, 0x1f,0x55,0x00, 0x1f,0x62,0x00, 0x1f,0x66,0x0f, 0x20,0x22,0x00, 0x20,0x28,0x08, 0x20,0x43,0x00, 0x20,0x49,0x00, 0x20,0x4b,0x00, 0x20,0x64,0x0d, 25 | 0x20,0x7c,0x00, 0x21,0x06,0x00, 0x21,0x21,0x00, 0x21,0x2a,0x04, 0x21,0x30,0x01, 0x21,0x3d,0x00, 0x21,0x43,0x00, 0x21,0x64,0x0c, 0x22,0x05,0x00, 0x22,0x20,0x00, 0x22,0x28,0x00, 0x22,0x2b,0x02, 0x22,0x31,0x01, 0x22,0x34,0x00, 0x22,0x3e,0x00, 0x22,0x43,0x00, 26 | 0x22,0x48,0x00, 0x22,0x4a,0x00, 0x22,0x64,0x09, 0x22,0x79,0x00, 0x23,0x09,0x00, 0x23,0x1f,0x00, 0x23,0x2c,0x01, 0x23,0x32,0x00, 0x23,0x74,0x00, 0x24,0x08,0x00, 0x24,0x1e,0x00, 0x24,0x2d,0x00, 0x24,0x2f,0x03, 0x24,0x34,0x00, 0x24,0x47,0x00, 0x24,0x49,0x00, 27 | 0x24,0x73,0x00, 0x25,0x1d,0x00, 0x25,0x24,0x00, 0x25,0x2b,0x00, 0x25,0x2d,0x02, 0x25,0x55,0x00, 0x25,0x71,0x00, 0x26,0x1a,0x00, 0x26,0x1c,0x00, 0x26,0x2e,0x00, 0x26,0x31,0x01, 0x26,0x48,0x00, 0x26,0x6c,0x01, 0x27,0x02,0x00, 0x27,0x06,0x00, 0x27,0x19,0x00, 28 | 0x27,0x22,0x00, 0x27,0x2c,0x00, 0x27,0x30,0x00, 0x27,0x42,0x00, 0x27,0x47,0x00, 0x27,0x54,0x00, 0x27,0x6b,0x00, 0x28,0x45,0x00, 0x28,0x53,0x00, 0x29,0x05,0x00, 0x29,0x18,0x00, 0x29,0x1a,0x00, 0x29,0x23,0x00, 0x29,0x43,0x00, 0x29,0x46,0x00, 0x29,0x52,0x00, 29 | 0x2a,0x01,0x00, 0x2a,0x21,0x00, 0x2a,0x48,0x00, 0x2a,0x4f,0x01, 0x2b,0x0d,0x00, 0x2b,0x11,0x01, 0x2b,0x22,0x00, 0x2b,0x44,0x00, 0x2c,0x04,0x00, 0x2c,0x0d,0x00, 0x2c,0x12,0x00, 0x2c,0x14,0x00, 0x2c,0x16,0x00, 0x2c,0x18,0x00, 0x2c,0x2f,0x04, 0x2d,0x00,0x00, 30 | 0x2d,0x15,0x00, 0x2d,0x20,0x00, 0x2d,0x2d,0x00, 0x2d,0x45,0x00, 0x2e,0x00,0x00, 0x2e,0x17,0x00, 0x2e,0x2d,0x00, 0x2e,0x45,0x00, 0x2f,0x1f,0x00, 0x30,0x03,0x00, 0x30,0x07,0x00, 0x30,0x16,0x00, 0x30,0x21,0x00, 0x30,0x26,0x00, 0x30,0x51,0x00, 0x30,0x55,0x00, 31 | 0x31,0x03,0x00, 0x31,0x07,0x00, 0x31,0x14,0x00, 0x31,0x1e,0x00, 0x31,0x29,0x00, 0x31,0x3a,0x05, 0x31,0x57,0x00, 0x32,0x03,0x00, 0x32,0x15,0x00, 0x32,0x2a,0x00, 0x32,0x2f,0x00, 0x33,0x1d,0x00, 0x33,0x22,0x00, 0x33,0x3d,0x00, 0x33,0x40,0x01, 0x34,0x00,0x00, 32 | 0x34,0x24,0x01, 0x34,0x2a,0x00, 0x34,0x30,0x00, 0x34,0x42,0x00, 0x35,0x00,0x00, 0x35,0x14,0x00, 0x35,0x42,0x00, 0x35,0x47,0x00, 0x35,0x4a,0x00, 0x35,0x6b,0x00, 0x36,0x04,0x00, 0x36,0x07,0x01, 0x36,0x1b,0x00, 0x36,0x3e,0x00, 0x36,0x45,0x00, 0x36,0x47,0x00, 33 | 0x36,0x4b,0x00, 0x36,0x58,0x00, 0x36,0x6b,0x00, 0x37,0x40,0x01, 0x37,0x43,0x00, 0x37,0x4f,0x00, 0x38,0x01,0x00, 0x38,0x08,0x01, 0x38,0x13,0x00, 0x38,0x1a,0x00, 0x38,0x31,0x00, 0x38,0x3e,0x01, 0x38,0x50,0x00, 0x39,0x06,0x00, 0x39,0x0a,0x00, 0x39,0x31,0x00, 34 | 0x39,0x3e,0x00, 0x39,0x41,0x00, 0x39,0x47,0x00, 0x39,0x52,0x03, 0x39,0x6a,0x00, 0x3a,0x11,0x00, 0x3a,0x19,0x00, 0x3a,0x31,0x00, 0x3a,0x40,0x00, 0x3a,0x48,0x00, 0x3b,0x09,0x00, 0x3b,0x0b,0x00, 0x3b,0x0e,0x02, 0x3b,0x12,0x00, 0x3b,0x1a,0x00, 0x3b,0x49,0x01, 35 | 0x3b,0x69,0x00, 0x3c,0x0b,0x00, 0x3c,0x0e,0x02, 0x3c,0x12,0x00, 0x3c,0x18,0x00, 0x3c,0x1e,0x02, 0x3c,0x26,0x00, 0x3c,0x32,0x00, 0x3c,0x3e,0x00, 0x3d,0x0f,0x01, 0x3d,0x24,0x00, 0x3d,0x3e,0x00, 0x3d,0x43,0x01, 0x3e,0x07,0x00, 0x3e,0x17,0x00, 0x3e,0x33,0x00, 36 | 0x3e,0x3e,0x00, 0x3e,0x42,0x00, 0x3f,0x09,0x00, 0x3f,0x1b,0x00, 0x3f,0x24,0x00, 0x3f,0x3e,0x00, 0x3f,0x67,0x00, 0x40,0x1f,0x00, 0x41,0x11,0x00, 0x41,0x16,0x00, 0x41,0x1f,0x00, 0x41,0x23,0x00, 0x41,0x34,0x00, 0x41,0x3e,0x00, 0x42,0x0b,0x00, 0x42,0x11,0x00, 37 | 0x42,0x23,0x00, 0x42,0x34,0x00, 0x42,0x3d,0x00, 0x42,0x50,0x00, 0x43,0x0f,0x00, 0x43,0x11,0x00, 0x43,0x1d,0x01, 0x43,0x34,0x00, 0x43,0x3e,0x00, 0x44,0x0a,0x00, 0x44,0x15,0x00, 0x44,0x20,0x00, 0x44,0x34,0x00, 0x44,0x3c,0x01, 0x44,0x54,0x00, 0x45,0x09,0x00, 38 | 0x45,0x15,0x00, 0x45,0x34,0x00, 0x45,0x4f,0x00, 0x45,0x55,0x00, 0x46,0x08,0x00, 0x46,0x0d,0x00, 0x46,0x40,0x00, 0x46,0x53,0x01, 0x46,0x5f,0x02, 0x46,0x66,0x00, 0x47,0x0d,0x00, 0x47,0x4a,0x00, 0x47,0x5d,0x05, 0x48,0x1b,0x00, 0x48,0x33,0x00, 0x48,0x3d,0x00, 39 | 0x48,0x58,0x0a, 0x48,0x67,0x00, 0x49,0x0d,0x00, 0x49,0x12,0x00, 0x49,0x14,0x00, 0x49,0x23,0x00, 0x49,0x4f,0x02, 0x49,0x56,0x0d, 0x4a,0x12,0x00, 0x4a,0x14,0x00, 0x4a,0x1a,0x00, 0x4a,0x21,0x00, 0x4a,0x32,0x00, 0x4a,0x3a,0x00, 0x4a,0x4d,0x16, 0x4b,0x06,0x00, 40 | 0x4b,0x0c,0x00, 0x4b,0x14,0x00, 0x4b,0x38,0x00, 0x4b,0x46,0x00, 0x4b,0x4b,0x18, 0x4c,0x06,0x00, 0x4c,0x13,0x01, 0x4c,0x22,0x00, 0x4c,0x36,0x00, 0x4c,0x4a,0x19, 0x4d,0x0d,0x00, 0x4d,0x10,0x00, 0x4d,0x27,0x00, 0x4d,0x2f,0x00, 0x4d,0x45,0x00, 0x4d,0x4a,0x19, 41 | 0x4e,0x0b,0x00, 0x4e,0x0e,0x00, 0x4e,0x24,0x00, 0x4e,0x2b,0x00, 0x4e,0x45,0x00, 0x4e,0x49,0x1a, 0x4f,0x07,0x00, 0x4f,0x49,0x19, 0x50,0x08,0x00, 0x50,0x0c,0x00, 0x50,0x16,0x00, 0x50,0x18,0x00, 0x50,0x20,0x00, 0x50,0x30,0x00, 0x50,0x49,0x18, 0x51,0x09,0x00, 42 | 0x51,0x2a,0x00, 0x51,0x49,0x17, 0x52,0x09,0x00, 0x52,0x45,0x00, 0x52,0x49,0x15, 0x53,0x09,0x00, 0x53,0x17,0x00, 0x53,0x28,0x00, 0x53,0x45,0x00, 0x53,0x4a,0x12, 0x54,0x17,0x01, 0x54,0x4a,0x10, 0x54,0x68,0x00, 0x55,0x17,0x00, 0x55,0x1e,0x00, 0x55,0x4a,0x0e, 43 | 0x55,0x5b,0x00, 0x56,0x25,0x00, 0x56,0x46,0x00, 0x56,0x4b,0x0b, 0x56,0x59,0x00, 0x56,0x66,0x00, 0x57,0x4d,0x05, 0x57,0x57,0x00, 0x57,0x64,0x00, 0x58,0x11,0x00, 0x58,0x19,0x00, 0x58,0x47,0x00, 0x58,0x54,0x00, 0x58,0x62,0x00, 0x59,0x15,0x00, 0x59,0x1f,0x00, 44 | 0x59,0x48,0x00, 0x59,0x50,0x01, 0x59,0x5f,0x00, 0x5a,0x4e,0x00, 0x5a,0x5e,0x00, 0x5b,0x0f,0x00, 0x5b,0x4a,0x00, 0x5b,0x50,0x02, 0x5c,0x11,0x00, 0x5c,0x19,0x00, 0x5c,0x5b,0x00, 0x5d,0x59,0x00, 0x5e,0x56,0x00, 0x5f,0x4f,0x03, 45 | }; 46 | 47 | const unsigned short fontmario2_CharOffs[2] PROGMEM = { 48 | 0x0000, 0x01de, 49 | }; 50 | 51 | RRE_Font rre_mario2 = { RRE_V24B, 96,128, 0x20, 0x20, (const uint8_t*)fontmario2_Rects, (const uint16_t*)fontmario2_CharOffs }; 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario3.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario3_h__ 2 | #define __font_mario3_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario3] 48x64 7 | Total chars: 4 (' ' to '#') 8 | Total rects: 106 * 3 bytes 9 | Total pixels: 2003 (886 overlapping) 10 | Total bytes: 326 (318 rects + 8 offs) 11 | Bitmap size: 1536 (48x64 * 4) (+4 opt) 12 | */ 13 | 14 | const unsigned char fontmario3_Rects[318] PROGMEM = { 15 | 0x9d,0x75,0x0f, 0xe4,0x78,0x0b, 0xd1,0x72,0x06, 0xd4,0x2d,0x06, 0x29,0xac,0x02, 0x55,0x3b,0x0a, 0x64,0x65,0x02, 0xd8,0x35,0x02, 0x90,0x71,0x05, 0x6a,0xa3,0x05, 0x9b,0x30,0x02, 0xe7,0x31,0x01, 0x53,0xee,0x02, 0x5d,0x33,0x02, 0xa2,0x77,0x0b, 0xef,0x0f,0x00, 16 | 0x62,0x25,0x01, 0xda,0x3a,0x01, 0x52,0x2f,0x0a, 0x2d,0x22,0x02, 0x63,0x27,0x00, 0x66,0x33,0x00, 0x20,0x34,0x01, 0x5c,0x39,0x00, 0x12,0x3a,0x04, 0x5c,0x32,0x02, 0xda,0x2e,0x01, 0x2f,0xe1,0x00, 0x28,0x2c,0x00, 0x2c,0x2d,0x00, 0x11,0x30,0x00, 0x28,0x30,0x00, 17 | 0x18,0x33,0x00, 0x25,0x34,0x00, 0x21,0x3c,0x00, 0x19,0x3d,0x00, 0x23,0x3e,0x00, 0xe7,0x64,0x08, 0x06,0xa8,0x15, 0x45,0x1e,0x45, 0x90,0xe4,0x09, 0x0e,0xe5,0x0d, 0x89,0x9c,0x02, 0x4f,0x32,0x08, 0x80,0x79,0x00, 0x0c,0xa7,0x10, 0x83,0x1f,0x01, 0x40,0x68,0x00, 18 | 0x0b,0x1b,0x03, 0x14,0x23,0x03, 0x0b,0x3f,0x03, 0x0d,0xe6,0x01, 0x00,0x13,0x01, 0x07,0x1d,0x01, 0x44,0x22,0x00, 0x4c,0x23,0x00, 0x5d,0x29,0x00, 0x03,0x2f,0x01, 0x0b,0x31,0x01, 0x05,0x09,0x00, 0x04,0x0b,0x00, 0x02,0x0c,0x00, 0x07,0x0c,0x00, 0x03,0x0d,0x00, 19 | 0x06,0x0f,0x00, 0x09,0x0f,0x00, 0x03,0x10,0x00, 0x05,0x10,0x00, 0x04,0x11,0x00, 0x07,0x11,0x00, 0x02,0x12,0x00, 0x0d,0x1a,0x00, 0x0c,0x1c,0x00, 0x0f,0x1c,0x00, 0x10,0x1e,0x00, 0x02,0x20,0x00, 0x11,0x20,0x00, 0x1a,0x24,0x00, 0x01,0x2a,0x00, 0xc1,0x2b,0x1c, 20 | 0x6c,0x03,0x03, 0x25,0x00,0x02, 0x2a,0x03,0x01, 0x27,0x01,0x00, 0xa8,0x00,0x07, 0x82,0x51,0x05, 0xc0,0x02,0x01, 0xd3,0x0e,0x01, 0xc1,0x12,0x07, 0x03,0x10,0x04, 0x4b,0x00,0x01, 0x42,0x04,0x01, 0x09,0x02,0x02, 0x40,0x00,0x00, 0x08,0x03,0x01, 0x06,0x04,0x01, 21 | 0x05,0x0f,0x01, 0x40,0x13,0x00, 0x04,0x18,0x01, 0x0d,0x00,0x00, 0x0a,0x01,0x00, 0x13,0x0d,0x00, 0x08,0x11,0x00, 0x15,0x14,0x00, 0x01,0x16,0x00, 0xd4,0x10,0x01, 22 | }; 23 | 24 | const unsigned short fontmario3_CharOffs[5] PROGMEM = { 25 | 0x0000, 0x0026, 0x0050, 0x0055, 0x006a, 26 | }; 27 | 28 | RRE_Font rre_mario3 = { RRE_24B, 48,64, 0x20, 0x23, (const uint8_t*)fontmario3_Rects, (const uint16_t*)fontmario3_CharOffs }; 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario3_v.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario3_h__ 2 | #define __font_mario3_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario3] 96x128 7 | Total chars: 1 (' ' to ' ') 8 | Total rects: 136 * 3 bytes 9 | Total pixels: 1117 (0 overlapping) 10 | Total bytes: 410 (408 rects + 2 offs) 11 | Bitmap size: 1536 (96x128 * 1) (+1 opt) 12 | */ 13 | 14 | const unsigned char fontmario3_Rects[408] PROGMEM = { 15 | 0x10,0x31,0x06, 0x11,0x30,0x09, 0x12,0x2f,0x0b, 0x13,0x2e,0x0d, 0x14,0x2d,0x0e, 0x15,0x2d,0x0f, 0x16,0x2d,0x03, 0x16,0x32,0x0a, 0x17,0x2d,0x03, 0x17,0x32,0x07, 0x17,0x3b,0x01, 0x18,0x2d,0x03, 0x18,0x33,0x00, 0x18,0x35,0x03, 0x18,0x3b,0x01, 0x19,0x2d,0x03, 16 | 0x19,0x35,0x03, 0x19,0x3b,0x02, 0x1a,0x2d,0x04, 0x1a,0x35,0x03, 0x1a,0x3a,0x03, 0x1b,0x2e,0x04, 0x1b,0x3a,0x03, 0x1c,0x2f,0x04, 0x1c,0x39,0x03, 0x1d,0x30,0x0c, 0x1e,0x32,0x0a, 0x1f,0x33,0x09, 0x20,0x34,0x07, 0x21,0x34,0x08, 0x22,0x25,0x01, 0x22,0x35,0x08, 17 | 0x23,0x25,0x03, 0x23,0x35,0x09, 0x24,0x25,0x05, 0x24,0x35,0x0a, 0x25,0x25,0x05, 0x25,0x34,0x0c, 0x26,0x25,0x05, 0x26,0x33,0x0d, 0x27,0x24,0x07, 0x27,0x31,0x10, 0x28,0x24,0x08, 0x28,0x30,0x12, 0x29,0x24,0x1e, 0x2a,0x23,0x20, 0x2b,0x23,0x20, 0x2c,0x23,0x0a, 18 | 0x2c,0x35,0x0f, 0x2d,0x22,0x0a, 0x2d,0x37,0x0d, 0x2e,0x22,0x0a, 0x2e,0x38,0x0c, 0x2f,0x0f,0x03, 0x2f,0x21,0x0c, 0x2f,0x38,0x0c, 0x30,0x13,0x00, 0x30,0x28,0x05, 0x30,0x39,0x0c, 0x30,0x53,0x01, 0x31,0x13,0x00, 0x31,0x2a,0x04, 0x31,0x42,0x03, 0x31,0x52,0x04, 19 | 0x32,0x0c,0x00, 0x32,0x12,0x00, 0x32,0x20,0x00, 0x32,0x2b,0x03, 0x32,0x44,0x01, 0x32,0x51,0x06, 0x33,0x0d,0x00, 0x33,0x10,0x00, 0x33,0x1f,0x02, 0x33,0x2b,0x04, 0x33,0x44,0x01, 0x33,0x50,0x07, 0x34,0x0b,0x00, 0x34,0x11,0x00, 0x34,0x1f,0x04, 0x34,0x2b,0x04, 20 | 0x34,0x50,0x08, 0x35,0x09,0x00, 0x35,0x10,0x00, 0x35,0x1e,0x11, 0x35,0x4f,0x09, 0x36,0x0f,0x00, 0x36,0x1e,0x12, 0x36,0x44,0x00, 0x36,0x4f,0x08, 0x37,0x0c,0x00, 0x37,0x11,0x00, 0x37,0x1d,0x13, 0x37,0x44,0x00, 0x37,0x50,0x07, 0x38,0x1d,0x13, 0x38,0x43,0x00, 21 | 0x38,0x51,0x04, 0x39,0x0f,0x00, 0x39,0x1c,0x14, 0x39,0x42,0x01, 0x3a,0x1c,0x14, 0x3a,0x41,0x01, 0x3b,0x1b,0x0b, 0x3b,0x28,0x09, 0x3b,0x3f,0x03, 0x3c,0x1b,0x01, 0x3c,0x23,0x01, 0x3c,0x27,0x0a, 0x3c,0x3f,0x02, 0x3d,0x1a,0x01, 0x3d,0x26,0x0c, 0x3d,0x3f,0x01, 22 | 0x3e,0x1b,0x00, 0x3e,0x25,0x0d, 0x3e,0x3f,0x00, 0x3f,0x1c,0x00, 0x3f,0x25,0x0e, 0x40,0x1e,0x00, 0x40,0x24,0x0f, 0x41,0x20,0x00, 0x41,0x24,0x0f, 0x42,0x24,0x0f, 0x43,0x24,0x0f, 0x43,0x4d,0x04, 0x44,0x23,0x10, 0x44,0x4e,0x05, 0x45,0x23,0x10, 0x45,0x50,0x04, 23 | 0x46,0x23,0x10, 0x47,0x23,0x10, 0x48,0x24,0x0e, 0x49,0x24,0x0e, 0x4a,0x24,0x0d, 0x4b,0x25,0x0c, 0x4c,0x27,0x08, 0x4d,0x29,0x05, 24 | }; 25 | 26 | const unsigned short fontmario3_CharOffs[2] PROGMEM = { 27 | 0x0000, 0x0088, 28 | }; 29 | 30 | RRE_Font rre_mario3 = { RRE_V24B, 96,128, 0x20, 0x20, (const uint8_t*)fontmario3_Rects, (const uint16_t*)fontmario3_CharOffs }; 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario4.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario4_h__ 2 | #define __font_mario4_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario4] 48x64 7 | Total chars: 4 (' ' to '#') 8 | Total rects: 110 * 3 bytes 9 | Total pixels: 1974 (889 overlapping) 10 | Total bytes: 338 (330 rects + 8 offs) 11 | Bitmap size: 1536 (48x64 * 4) (+4 opt) 12 | */ 13 | 14 | const unsigned char fontmario4_Rects[330] PROGMEM = { 15 | 0xe0,0x8c,0x0a, 0x9a,0x95,0x06, 0x0e,0x66,0x0b, 0xd7,0x9b,0x04, 0x28,0x5b,0x06, 0x66,0x47,0x05, 0xdd,0x90,0x07, 0xa4,0x1f,0x05, 0x6b,0x59,0x04, 0xd5,0x21,0x07, 0xe2,0xca,0x04, 0x0d,0x68,0x03, 0x9b,0xd3,0x03, 0x18,0x59,0x0a, 0x62,0x21,0x04, 0xe6,0x1d,0x06, 16 | 0x65,0x08,0x08, 0x96,0x9e,0x04, 0xeb,0x13,0x00, 0x51,0x24,0x01, 0x59,0x17,0x0f, 0x2d,0x04,0x02, 0x2d,0x18,0x02, 0x9f,0x0e,0x40, 0xa8,0x06,0x06, 0x8f,0x65,0x02, 0x14,0x25,0x01, 0x0e,0x2d,0x01, 0x64,0x09,0x08, 0xe1,0x0b,0x40, 0x1c,0x12,0x41, 0x5e,0xcf,0x05, 17 | 0x2c,0x15,0x00, 0x2f,0x17,0x00, 0x25,0x1a,0x00, 0x2a,0x1a,0x00, 0x27,0x1c,0x00, 0x25,0x1e,0x00, 0x23,0x20,0x00, 0x21,0x22,0x00, 0x0e,0x2e,0x00, 0xaa,0x05,0x05, 0x8d,0x12,0x0b, 0xc3,0x15,0x08, 0x40,0x57,0x04, 0x80,0x04,0x05, 0xc9,0x13,0x07, 0x80,0x4c,0x01, 18 | 0x84,0x0c,0x02, 0x01,0x56,0x06, 0x87,0x0e,0x01, 0x43,0x3e,0x02, 0x42,0x0e,0x03, 0x46,0x14,0x0d, 0x46,0x05,0x01, 0x07,0x07,0x02, 0x00,0x1d,0x02, 0x09,0x08,0x01, 0x45,0x0a,0x00, 0x4c,0x0c,0x00, 0x0c,0x17,0x01, 0x08,0x19,0x01, 0x52,0x3e,0x00, 0x08,0x06,0x00, 19 | 0x0a,0x09,0x00, 0x0b,0x0a,0x00, 0x00,0x0b,0x00, 0x06,0x0b,0x00, 0x02,0x0d,0x00, 0x07,0x0d,0x00, 0x04,0x10,0x00, 0x09,0x10,0x00, 0x08,0x11,0x00, 0x05,0x1b,0x00, 0x00,0x1e,0x00, 0x13,0x3d,0x00, 0x06,0x3f,0x00, 0x11,0x3f,0x00, 0x19,0x13,0x02, 0xdf,0x4c,0x08, 20 | 0x17,0x45,0x08, 0xda,0x04,0x09, 0x5e,0x4f,0x08, 0x16,0x46,0x07, 0xa8,0x87,0x01, 0xa1,0x8b,0x03, 0x94,0x07,0x01, 0x18,0x0b,0x04, 0x64,0x05,0x01, 0x12,0x08,0x0f, 0x9d,0x11,0x00, 0x23,0x8a,0x05, 0x19,0x0c,0x01, 0x24,0x04,0x00, 0x15,0x06,0x00, 0x28,0x06,0x00, 21 | 0x27,0x08,0x00, 0x20,0x15,0x00, 0x65,0x49,0x05, 0x86,0x08,0x03, 0x44,0x00,0x02, 0x0f,0x01,0x01, 0x07,0x07,0x01, 0x04,0x08,0x01, 0x4a,0x09,0x00, 0x0f,0x02,0x00, 0x0e,0x03,0x00, 0x05,0x09,0x00, 0x08,0x16,0x00, 0x10,0x00,0x01, 22 | }; 23 | 24 | const unsigned short fontmario4_CharOffs[5] PROGMEM = { 25 | 0x0000, 0x002a, 0x004f, 0x0063, 0x006e, 26 | }; 27 | 28 | RRE_Font rre_mario4 = { RRE_24B, 48,64, 0x20, 0x23, (const uint8_t*)fontmario4_Rects, (const uint16_t*)fontmario4_CharOffs }; 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario4_v.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario4_h__ 2 | #define __font_mario4_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario4] 96x128 7 | Total chars: 1 (' ' to ' ') 8 | Total rects: 155 * 3 bytes 9 | Total pixels: 1085 (0 overlapping) 10 | Total bytes: 467 (465 rects + 2 offs) 11 | Bitmap size: 1536 (96x128 * 1) (+1 opt) 12 | */ 13 | 14 | const unsigned char fontmario4_Rects[465] PROGMEM = { 15 | 0x0d,0x28,0x04, 0x0e,0x26,0x08, 0x0f,0x25,0x08, 0x10,0x25,0x07, 0x11,0x24,0x07, 0x12,0x24,0x06, 0x12,0x48,0x00, 0x13,0x26,0x04, 0x13,0x48,0x00, 0x14,0x25,0x05, 0x14,0x47,0x02, 0x15,0x21,0x09, 0x15,0x46,0x03, 0x16,0x1e,0x0c, 0x16,0x46,0x04, 0x17,0x1b,0x0f, 16 | 0x17,0x45,0x05, 0x18,0x19,0x11, 0x18,0x45,0x06, 0x19,0x17,0x13, 0x19,0x45,0x07, 0x1a,0x15,0x13, 0x1a,0x44,0x08, 0x1b,0x13,0x13, 0x1b,0x44,0x07, 0x1c,0x12,0x12, 0x1c,0x44,0x07, 0x1d,0x10,0x12, 0x1d,0x44,0x06, 0x1d,0x51,0x02, 0x1e,0x0f,0x12, 0x1e,0x44,0x05, 17 | 0x1e,0x4f,0x05, 0x1f,0x0e,0x12, 0x1f,0x44,0x05, 0x1f,0x4c,0x08, 0x20,0x0c,0x13, 0x20,0x44,0x04, 0x20,0x4c,0x09, 0x21,0x0b,0x13, 0x21,0x22,0x00, 0x21,0x44,0x04, 0x21,0x4b,0x0a, 0x22,0x0a,0x13, 0x22,0x21,0x01, 0x22,0x44,0x03, 0x22,0x4b,0x0a, 0x23,0x0a,0x12, 18 | 0x23,0x20,0x02, 0x23,0x44,0x03, 0x23,0x4a,0x0b, 0x24,0x09,0x12, 0x24,0x1f,0x03, 0x24,0x44,0x02, 0x24,0x4a,0x0b, 0x25,0x08,0x12, 0x25,0x1e,0x04, 0x25,0x45,0x01, 0x25,0x49,0x0b, 0x26,0x07,0x12, 0x26,0x1d,0x05, 0x26,0x49,0x0b, 0x27,0x07,0x11, 0x27,0x1c,0x05, 19 | 0x27,0x48,0x0b, 0x28,0x06,0x12, 0x28,0x1b,0x06, 0x28,0x46,0x0c, 0x29,0x06,0x11, 0x29,0x1b,0x06, 0x29,0x47,0x0a, 0x2a,0x05,0x12, 0x2a,0x1a,0x06, 0x2a,0x49,0x05, 0x2b,0x05,0x07, 0x2b,0x13,0x03, 0x2b,0x19,0x07, 0x2c,0x05,0x05, 0x2c,0x15,0x00, 0x2c,0x19,0x07, 20 | 0x2d,0x04,0x05, 0x2d,0x18,0x07, 0x2e,0x04,0x04, 0x2e,0x18,0x07, 0x2f,0x04,0x03, 0x2f,0x17,0x07, 0x30,0x04,0x02, 0x30,0x0b,0x07, 0x30,0x17,0x07, 0x31,0x04,0x02, 0x31,0x0c,0x06, 0x31,0x16,0x07, 0x32,0x04,0x02, 0x32,0x0d,0x02, 0x32,0x16,0x07, 0x33,0x04,0x02, 21 | 0x33,0x0e,0x01, 0x33,0x15,0x07, 0x33,0x3e,0x01, 0x34,0x04,0x02, 0x34,0x0c,0x04, 0x34,0x15,0x07, 0x34,0x3e,0x03, 0x34,0x48,0x00, 0x35,0x04,0x02, 0x35,0x0a,0x05, 0x35,0x15,0x06, 0x35,0x3e,0x03, 0x35,0x48,0x01, 0x36,0x05,0x01, 0x36,0x0b,0x03, 0x36,0x14,0x06, 22 | 0x36,0x3f,0x02, 0x36,0x48,0x02, 0x37,0x05,0x02, 0x37,0x0d,0x03, 0x37,0x14,0x06, 0x37,0x47,0x03, 0x38,0x06,0x01, 0x38,0x0e,0x03, 0x38,0x14,0x05, 0x38,0x47,0x03, 0x38,0x56,0x00, 0x39,0x07,0x01, 0x39,0x10,0x00, 0x39,0x13,0x06, 0x39,0x48,0x02, 0x3a,0x08,0x01, 23 | 0x3a,0x13,0x05, 0x3a,0x49,0x01, 0x3b,0x0a,0x00, 0x3b,0x13,0x05, 0x3c,0x0c,0x01, 0x3c,0x13,0x04, 0x3d,0x12,0x05, 0x3e,0x12,0x04, 0x3e,0x43,0x00, 0x3f,0x12,0x04, 0x3f,0x41,0x01, 0x40,0x12,0x04, 0x40,0x40,0x01, 0x41,0x12,0x03, 0x41,0x3f,0x01, 0x42,0x12,0x03, 24 | 0x42,0x3e,0x01, 0x43,0x12,0x03, 0x43,0x3d,0x00, 0x44,0x12,0x02, 0x45,0x12,0x02, 0x46,0x12,0x02, 0x47,0x12,0x02, 0x48,0x12,0x02, 0x49,0x13,0x00, 0x4a,0x13,0x00, 0x4b,0x13,0x00, 25 | }; 26 | 27 | const unsigned short fontmario4_CharOffs[2] PROGMEM = { 28 | 0x0000, 0x009b, 29 | }; 30 | 31 | RRE_Font rre_mario4 = { RRE_V24B, 96,128, 0x20, 0x20, (const uint8_t*)fontmario4_Rects, (const uint16_t*)fontmario4_CharOffs }; 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario5.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario5_h__ 2 | #define __font_mario5_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario5] 48x64 7 | Total chars: 4 (' ' to '#') 8 | Total rects: 89 * 3 bytes 9 | Total pixels: 1004 (288 overlapping) 10 | Total bytes: 275 (267 rects + 8 offs) 11 | Bitmap size: 1536 (48x64 * 4) (+4 opt) 12 | */ 13 | 14 | const unsigned char fontmario5_Rects[267] PROGMEM = { 15 | 0xad,0x4c,0x01, 0x6e,0x13,0x01, 0x2e,0x0b,0x00, 0x2f,0x4a,0x00, 0x1b,0x5a,0x09, 0xe1,0x4f,0x05, 0x94,0x1d,0x08, 0xdd,0x19,0x09, 0x40,0x09,0x04, 0x67,0x91,0x00, 0x5e,0x22,0x04, 0x9f,0x0d,0x03, 0x18,0x5c,0x04, 0x88,0x0b,0x01, 0x15,0x0e,0x05, 0x1e,0x1f,0x04, 16 | 0x20,0x4e,0x04, 0x46,0x09,0x01, 0x1a,0x0b,0x03, 0xca,0x0d,0x00, 0x18,0x0f,0x03, 0x01,0x0b,0x02, 0x03,0x12,0x02, 0x1c,0x21,0x02, 0x03,0x08,0x01, 0x1d,0x0c,0x01, 0x42,0x10,0x00, 0x46,0x10,0x00, 0x1e,0x18,0x01, 0x25,0x18,0x01, 0x1f,0x24,0x01, 0x47,0x0a,0x01, 17 | 0x57,0x1c,0x0e, 0x03,0x0c,0x00, 0x1e,0x0d,0x00, 0x09,0x0e,0x00, 0x1c,0x10,0x00, 0x03,0x11,0x00, 0x05,0x11,0x00, 0x1a,0x1b,0x00, 0x1d,0x22,0x00, 0x28,0x53,0x00, 0x50,0xcd,0x06, 0x07,0x5c,0x0b, 0x4d,0x8b,0x04, 0x57,0x94,0x02, 0xc4,0x19,0x07, 0x0e,0x9b,0x04, 18 | 0x0b,0x8f,0x01, 0xc5,0x93,0x01, 0x8d,0x70,0x01, 0x88,0x10,0x02, 0x12,0x0c,0x42, 0x4b,0x21,0x02, 0x0e,0xec,0x00, 0x07,0x51,0x00, 0xca,0x96,0x01, 0x4a,0x0f,0x0e, 0xc4,0x15,0x00, 0xcf,0x2a,0x00, 0x90,0x27,0x00, 0x4c,0x0b,0x00, 0x59,0x10,0x00, 0x57,0x12,0x00, 19 | 0x4d,0x15,0x00, 0x13,0x22,0x01, 0x46,0x12,0x02, 0x4f,0x1a,0x06, 0x89,0x5b,0x03, 0x0b,0x0c,0x00, 0x17,0x0e,0x00, 0x18,0x13,0x00, 0x13,0x1d,0x00, 0x16,0x1d,0x00, 0x06,0x1f,0x00, 0x15,0x21,0x00, 0x9a,0x56,0x00, 0xe9,0x13,0x00, 0xa8,0x16,0x00, 0xa7,0x18,0x00, 20 | 0x03,0x0f,0x01, 0x65,0x1c,0x00, 0x64,0x1f,0x00, 0x63,0x21,0x00, 0x62,0x22,0x00, 0x02,0x10,0x00, 0x01,0x11,0x00, 0x26,0x1b,0x00, 0x2a,0x4f,0x00, 21 | }; 22 | 23 | const unsigned short fontmario5_CharOffs[5] PROGMEM = { 24 | 0x0000, 0x0004, 0x002a, 0x004d, 0x0059, 25 | }; 26 | 27 | RRE_Font rre_mario5 = { RRE_24B, 48,64, 0x20, 0x23, (const uint8_t*)fontmario5_Rects, (const uint16_t*)fontmario5_CharOffs }; 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario5_v.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario5_h__ 2 | #define __font_mario5_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario5] 96x128 7 | Total chars: 1 (' ' to ' ') 8 | Total rects: 124 * 3 bytes 9 | Total pixels: 716 (0 overlapping) 10 | Total bytes: 374 (372 rects + 2 offs) 11 | Bitmap size: 1536 (96x128 * 1) (+1 opt) 12 | */ 13 | 14 | const unsigned char fontmario5_Rects[372] PROGMEM = { 15 | 0x04,0x55,0x07, 0x05,0x53,0x0b, 0x06,0x52,0x0d, 0x07,0x51,0x04, 0x07,0x59,0x07, 0x08,0x50,0x03, 0x08,0x59,0x07, 0x09,0x50,0x02, 0x09,0x59,0x08, 0x0a,0x4f,0x03, 0x0a,0x56,0x0b, 0x0b,0x4c,0x00, 0x0b,0x4f,0x13, 0x0c,0x4b,0x01, 0x0c,0x4f,0x08, 0x0c,0x5b,0x07, 16 | 0x0d,0x4b,0x0b, 0x0d,0x5c,0x06, 0x0d,0x70,0x06, 0x0e,0x4b,0x09, 0x0e,0x5b,0x08, 0x0e,0x6c,0x0c, 0x0f,0x4b,0x09, 0x0f,0x5a,0x09, 0x0f,0x6a,0x03, 0x10,0x4b,0x18, 0x10,0x67,0x02, 0x11,0x4b,0x18, 0x12,0x4c,0x17, 0x13,0x4c,0x11, 0x13,0x62,0x00, 0x14,0x4c,0x10, 17 | 0x14,0x62,0x00, 0x15,0x4d,0x0e, 0x15,0x61,0x00, 0x16,0x4d,0x0d, 0x16,0x5d,0x00, 0x17,0x4e,0x02, 0x17,0x52,0x0b, 0x18,0x4f,0x01, 0x18,0x53,0x0a, 0x19,0x50,0x01, 0x19,0x54,0x09, 0x1a,0x56,0x06, 0x2d,0x0c,0x06, 0x2e,0x0b,0x09, 0x2f,0x0a,0x04, 0x2f,0x13,0x01, 18 | 0x30,0x09,0x01, 0x31,0x09,0x02, 0x31,0x51,0x00, 0x32,0x09,0x02, 0x32,0x10,0x01, 0x32,0x50,0x00, 0x33,0x08,0x04, 0x33,0x11,0x01, 0x33,0x4f,0x00, 0x34,0x08,0x02, 0x34,0x12,0x00, 0x34,0x4f,0x00, 0x35,0x11,0x01, 0x36,0x09,0x01, 0x36,0x10,0x01, 0x37,0x09,0x02, 19 | 0x38,0x0a,0x03, 0x39,0x0b,0x03, 0x3a,0x0d,0x03, 0x44,0x1d,0x02, 0x45,0x0e,0x00, 0x45,0x1d,0x02, 0x46,0x0e,0x00, 0x46,0x1d,0x02, 0x47,0x0e,0x00, 0x47,0x1c,0x03, 0x48,0x0e,0x01, 0x48,0x1c,0x04, 0x49,0x0e,0x01, 0x49,0x1c,0x04, 0x4a,0x0b,0x00, 0x4a,0x0e,0x01, 20 | 0x4a,0x1b,0x05, 0x4b,0x0b,0x00, 0x4b,0x0f,0x00, 0x4b,0x1a,0x06, 0x4c,0x0b,0x00, 0x4c,0x10,0x00, 0x4c,0x1a,0x07, 0x4d,0x0b,0x01, 0x4d,0x19,0x05, 0x4d,0x21,0x01, 0x4e,0x0c,0x01, 0x4e,0x18,0x07, 0x4e,0x21,0x02, 0x4f,0x0d,0x02, 0x4f,0x18,0x07, 0x4f,0x22,0x02, 21 | 0x50,0x0d,0x05, 0x50,0x19,0x06, 0x50,0x22,0x02, 0x51,0x0d,0x09, 0x51,0x19,0x06, 0x51,0x22,0x01, 0x52,0x0d,0x09, 0x52,0x19,0x06, 0x52,0x22,0x01, 0x52,0x62,0x01, 0x53,0x0e,0x08, 0x53,0x19,0x05, 0x53,0x61,0x01, 0x54,0x0e,0x08, 0x54,0x19,0x05, 0x54,0x5f,0x01, 22 | 0x55,0x0f,0x07, 0x55,0x18,0x05, 0x55,0x5c,0x01, 0x56,0x0f,0x07, 0x56,0x18,0x04, 0x56,0x5b,0x00, 0x57,0x11,0x09, 0x57,0x58,0x02, 0x58,0x13,0x04, 0x58,0x56,0x02, 0x59,0x53,0x03, 0x5a,0x4f,0x04, 23 | }; 24 | 25 | const unsigned short fontmario5_CharOffs[2] PROGMEM = { 26 | 0x0000, 0x007c, 27 | }; 28 | 29 | RRE_Font rre_mario5 = { RRE_V24B, 96,128, 0x20, 0x20, (const uint8_t*)fontmario5_Rects, (const uint16_t*)fontmario5_CharOffs }; 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario6.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario6_h__ 2 | #define __font_mario6_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario6] 48x64 7 | Total chars: 4 (' ' to '#') 8 | Total rects: 48 * 3 bytes 9 | Total pixels: 1099 (409 overlapping) 10 | Total bytes: 152 (144 rects + 8 offs) 11 | Bitmap size: 1536 (48x64 * 4) (+4 opt) 12 | */ 13 | 14 | const unsigned char fontmario6_Rects[144] PROGMEM = { 15 | 0x9e,0x58,0x07, 0xed,0x87,0x01, 0xa9,0x15,0x45, 0xab,0x52,0x42, 0x61,0x1f,0x04, 0xef,0x48,0x00, 0x25,0xd7,0x03, 0x1d,0x17,0x03, 0xac,0x07,0x00, 0xac,0x0f,0x00, 0x6e,0x27,0x01, 0x23,0x21,0x01, 0x27,0x27,0x01, 0x2a,0x14,0x00, 0x1d,0x16,0x00, 0x28,0x16,0x00, 16 | 0x1d,0x1d,0x00, 0x20,0x1f,0x00, 0x25,0x26,0x00, 0xa6,0xd8,0x09, 0x80,0x9b,0x0b, 0x0b,0x4c,0x45, 0x51,0x95,0x01, 0xc0,0x0a,0x03, 0x40,0x26,0x06, 0x89,0x98,0x06, 0xc9,0x0c,0x01, 0x53,0x56,0x00, 0x06,0xda,0x03, 0x40,0x08,0x01, 0x4e,0x0a,0x01, 0x05,0x0d,0x03, 17 | 0x51,0xd2,0x00, 0x00,0x1a,0x02, 0xc8,0x99,0x04, 0x4c,0x07,0x00, 0x4d,0x08,0x00, 0x4a,0x10,0x00, 0xc0,0xd9,0x00, 0x0b,0x06,0x00, 0x02,0x09,0x00, 0x0e,0x09,0x00, 0x10,0x0b,0x00, 0x04,0x0c,0x00, 0x00,0x0e,0x00, 0x08,0x0e,0x00, 0x0d,0x23,0x00, 0x4a,0x17,0x0a, 18 | }; 19 | 20 | const unsigned short fontmario6_CharOffs[5] PROGMEM = { 21 | 0x0000, 0x0000, 0x0000, 0x0014, 0x0030, 22 | }; 23 | 24 | RRE_Font rre_mario6 = { RRE_24B, 48,64, 0x20, 0x23, (const uint8_t*)fontmario6_Rects, (const uint16_t*)fontmario6_CharOffs }; 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /examples/ST7735_Mario_RRE/rre_mario6_v.h: -------------------------------------------------------------------------------- 1 | #ifndef __font_mario6_h__ 2 | #define __font_mario6_h__ 3 | 4 | /* 5 | *** Generated by rrefontgen *** 6 | Font: [mario6] 96x128 7 | Total chars: 1 (' ' to ' ') 8 | Total rects: 59 * 3 bytes 9 | Total pixels: 690 (0 overlapping) 10 | Total bytes: 179 (177 rects + 2 offs) 11 | Bitmap size: 1536 (96x128 * 1) (+1 opt) 12 | */ 13 | 14 | const unsigned char fontmario6_Rects[177] PROGMEM = { 15 | 0x1d,0x56,0x01, 0x1d,0x5d,0x00, 0x1e,0x57,0x07, 0x1f,0x57,0x07, 0x20,0x57,0x08, 0x21,0x58,0x08, 0x22,0x58,0x08, 0x23,0x58,0x09, 0x24,0x58,0x09, 0x25,0x57,0x0c, 0x25,0x66,0x00, 0x26,0x57,0x0f, 0x27,0x57,0x10, 0x28,0x56,0x11, 0x29,0x55,0x12, 0x2a,0x54,0x13, 16 | 0x2b,0x52,0x16, 0x2c,0x47,0x02, 0x2c,0x4f,0x19, 0x2d,0x47,0x21, 0x2e,0x47,0x0b, 0x2e,0x55,0x13, 0x2f,0x48,0x07, 0x2f,0x58,0x10, 0x30,0x48,0x06, 0x30,0x59,0x0f, 0x31,0x48,0x05, 0x31,0x5a,0x0d, 0x32,0x49,0x04, 0x32,0x5a,0x0d, 0x33,0x4a,0x03, 0x33,0x5b,0x0c, 17 | 0x34,0x4c,0x00, 0x34,0x5b,0x0c, 0x35,0x4d,0x00, 0x35,0x5b,0x0c, 0x36,0x4d,0x00, 0x36,0x5a,0x0d, 0x37,0x4d,0x00, 0x37,0x5a,0x0c, 0x38,0x4d,0x01, 0x38,0x59,0x0d, 0x39,0x4c,0x03, 0x39,0x58,0x0e, 0x3a,0x4c,0x05, 0x3a,0x57,0x0e, 0x3b,0x46,0x00, 0x3b,0x4c,0x19, 18 | 0x3c,0x47,0x01, 0x3c,0x4c,0x18, 0x3d,0x48,0x01, 0x3d,0x4c,0x17, 0x3e,0x49,0x19, 0x3f,0x4a,0x18, 0x40,0x4b,0x15, 0x41,0x52,0x0d, 0x42,0x55,0x09, 0x43,0x56,0x05, 0x44,0x57,0x01, 19 | }; 20 | 21 | const unsigned short fontmario6_CharOffs[2] PROGMEM = { 22 | 0x0000, 0x003b, 23 | }; 24 | 25 | RRE_Font rre_mario6 = { RRE_V24B, 96,128, 0x20, 0x20, (const uint8_t*)fontmario6_Rects, (const uint16_t*)fontmario6_CharOffs }; 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /examples/ST7735_MovingText/ST7735_MovingText.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library example 2 | // (C)2019 Pawel A. Hernik 3 | 4 | // requires RRE Font library: 5 | // https://github.com/cbm80amiga/RREFont 6 | 7 | /* 8 | ST7735 128x160 1.8" LCD pinout (header at the top, from left): 9 | #1 LED -> 3.3V 10 | #2 SCK -> SCL/D13/PA5 11 | #3 SDA -> MOSI/D11/PA7 12 | #4 A0/DC -> D8/PA1 or any digital 13 | #5 RESET -> D9/PA0 or any digital 14 | #6 CS -> D10/PA2 or any digital 15 | #7 GND -> GND 16 | #8 VCC -> 3.3V 17 | */ 18 | 19 | #define SCR_WD 128 20 | #define SCR_HT 160 21 | #include 22 | #include 23 | 24 | #if (__STM32F1__) // bluepill 25 | #define TFT_CS PA2 26 | #define TFT_DC PA1 27 | #define TFT_RST PA0 28 | //#include 29 | #else 30 | #define TFT_CS 10 31 | #define TFT_DC 8 32 | #define TFT_RST 9 33 | #include 34 | #endif 35 | 36 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 37 | 38 | #include "RREFont.h" 39 | #include "rre_chicago_20x24.h" 40 | 41 | RREFont font; 42 | 43 | // needed for RREFont library initialization, define your fillRect 44 | void customRect(int x, int y, int w, int h, int c) { return lcd.fillRect(x, y, w, h, c); } 45 | 46 | void setup() 47 | { 48 | Serial.begin(9600); 49 | lcd.init(); 50 | lcd.fillScreen(BLACK); 51 | 52 | font.init(customRect, SCR_WD, SCR_HT); // custom fillRect function and screen width and height values 53 | font.setFont(&rre_chicago_20x24); 54 | int i; 55 | for(i=0;i<10;i++) { 56 | font.setColor(RGBto565(i*25,i*25,i*25)); 57 | font.printStr(30+i,20+i,"Hello"); 58 | } 59 | font.setColor(WHITE); 60 | font.printStr(30+i,20+i,"Hello"); 61 | 62 | for(i=0;i<10;i++) { 63 | font.setColor(lcd.rgbWheel(0+i*8)); 64 | font.printStr(25+i,60+i,"World"); 65 | } 66 | font.setColor(WHITE); 67 | font.printStr(25+i,60+i,"World"); 68 | delay(4000); 69 | lcd.fillScreen(); 70 | } 71 | 72 | #define MAX_TXT 32 73 | byte tx[MAX_TXT]; 74 | byte ty[MAX_TXT]; 75 | byte cur=0; 76 | int numTxt=16; 77 | int x=0,y=0; 78 | int dx=6,dy=5; 79 | int i,ii,cc=0; 80 | 81 | void loop() 82 | { 83 | x+=dx; 84 | y+=dy; 85 | if(x>SCR_WD-20) { dx=-dx; x=SCR_WD-20; } 86 | if(x<1) { dx=-dx; x=0; } 87 | if(y>SCR_HT-20) { dy=-dy; y=SCR_HT-20; } 88 | if(y<1) { dy=-dy; y=0; } 89 | int i=cur; 90 | //font.setColor(BLACK); 91 | //font.printStr(tx[i],ty[i],"Hello!"); 92 | tx[cur]=x; 93 | ty[cur]=y; 94 | if(++cur>=numTxt) cur=0; 95 | for(i=0;i=numTxt) ii-=numTxt; 98 | font.setColor(RGBto565(i*15,i*5,0)); 99 | if(i==numTxt-1) font.setColor(WHITE); 100 | font.printStr(tx[ii],ty[ii],"Hello!"); 101 | cc++; 102 | } 103 | delay(20); 104 | } 105 | 106 | -------------------------------------------------------------------------------- /examples/ST7735_Rotation/ST7735_Rotation.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library example 2 | // (c) 2019 Pawel A. Hernik 3 | 4 | /* 5 | ST7735 128x160 1.8" LCD pinout (header at the top, from left): 6 | #1 LED -> 3.3V 7 | #2 SCK -> SCL/D13/PA5 8 | #3 SDA -> MOSI/D11/PA7 9 | #4 A0/DC -> D8/PA1 or any digital 10 | #5 RESET -> D9/PA0 or any digital 11 | #6 CS -> D10/PA2 or any digital 12 | #7 GND -> GND 13 | #8 VCC -> 3.3V 14 | */ 15 | 16 | #define SCR_WD 128 17 | #define SCR_HT 160 18 | #include 19 | #include 20 | 21 | #if (__STM32F1__) // bluepill 22 | #define TFT_CS PA2 23 | #define TFT_DC PA1 24 | #define TFT_RST PA0 25 | //#include 26 | #else 27 | #define TFT_CS 10 28 | #define TFT_DC 8 29 | #define TFT_RST 9 30 | #include 31 | #endif 32 | 33 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 34 | 35 | void setup() 36 | { 37 | Serial.begin(9600); 38 | lcd.init(); 39 | } 40 | 41 | void loop(void) 42 | { 43 | for(uint8_t rot = 0; rot < 4; rot++) { 44 | testText(rot); 45 | delay(2000); 46 | } 47 | } 48 | 49 | unsigned long testText(int rot) 50 | { 51 | lcd.setRotation(rot); 52 | lcd.fillScreen(BLACK); 53 | lcd.setCursor(0, 0); 54 | lcd.setTextColor(BLUE); 55 | lcd.setTextSize(1); 56 | lcd.println("Hello World!"); 57 | lcd.setTextColor(WHITE); 58 | lcd.print("Rotation = "); 59 | lcd.println(rot); 60 | lcd.setTextColor(YELLOW); 61 | lcd.setTextSize(2); 62 | lcd.println(1234.56); 63 | lcd.setTextColor(RED); 64 | lcd.setTextSize(3); 65 | lcd.println(0xDEAD, HEX); 66 | lcd.println(); 67 | lcd.setTextColor(GREEN); 68 | lcd.setTextSize(4); 69 | lcd.println("Hello"); 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /examples/ST7735_Scroll/ST7735_Scroll.ino: -------------------------------------------------------------------------------- 1 | // ST7735 library example 2 | // (c) 2019 Pawel A. Hernik 3 | 4 | // requires RRE Font library: 5 | // https://github.com/cbm80amiga/RREFont 6 | 7 | /* 8 | ST7735 128x160 LCD pinout (header at the top for better viewwing angles, from left): 9 | #1 LED -> 3.3V 10 | #2 SCK -> SCL/D13/PA5 11 | #3 SDA -> MOSI/D11/PA7 12 | #4 A0/DC -> D8/PA1 or any digital 13 | #5 RESET -> D9/PA0 or any digital 14 | #6 CS -> D10/PA2 or any digital 15 | #7 GND -> GND 16 | #8 VCC -> 3.3V 17 | */ 18 | 19 | #define SCR_WD 128 20 | #define SCR_HT 160 21 | 22 | #include 23 | #include 24 | 25 | #if (__STM32F1__) // bluepill 26 | #define TFT_CS PA2 27 | #define TFT_DC PA1 28 | #define TFT_RST PA0 29 | //#include 30 | #else 31 | #define TFT_CS 10 32 | #define TFT_DC 8 33 | #define TFT_RST 9 34 | #include 35 | #endif 36 | 37 | Arduino_ST7735 lcd = Arduino_ST7735(TFT_DC, TFT_RST, TFT_CS); 38 | 39 | #include "RREFont.h" 40 | #include "rre_arialb_16.h" 41 | 42 | RREFont font; 43 | 44 | // needed for RREFont library initialization, define your fillRect 45 | void customRect(int x, int y, int w, int h, int c) { return lcd.fillRect(x, y, w, h, c); } 46 | 47 | void setup() 48 | { 49 | Serial.begin(9600); 50 | lcd.init(); 51 | font.init(customRect, SCR_WD, SCR_HT); // custom fillRect function and screen width and height values 52 | 53 | for(int i=0;i=maxy) y-=maxy; 88 | if((i%16)==0) { 89 | lcd.fillRect(0,y,128,16,RGBto565(0,0,bgCols[c]<<4)); 90 | font.printStr(ALIGN_CENTER,y+1,scrollTxt[t]); 91 | if(++c>=sizeof(bgCols)/sizeof(bgCols[0])) c=0; 92 | if(++t>=sizeof(scrollTxt)/sizeof(scrollTxt[0])) t=0; 93 | //Serial.println(millis()-ms); // less than 25ms per line 94 | } 95 | while(millis()-ms<25); 96 | } 97 | 98 | // scrolling with fixed top area 99 | lcd.fillRect(0,0,128,3,RGBto565(220,0,220)); 100 | lcd.fillRect(0,3,128,32-6,RGBto565(180,0,180)); 101 | lcd.fillRect(0,32-3,128,3,RGBto565(140,0,140)); 102 | font.setScale(1); font.setSpacing(1); 103 | font.setColor(YELLOW); 104 | font.printStr(ALIGN_CENTER,8,"Fixed Top Area"); 105 | font.setColor(WHITE); 106 | font.setScale(1); font.setSpacing(3); 107 | lcd.setScrollArea(32, 0); 108 | for(int l=0;l<3;l++) 109 | for(int i=32;i=maxy) {y-=maxy; y+=32;} 114 | if((i%16)==0) { 115 | lcd.fillRect(0,y,128,16,RGBto565(0,0,bgCols[c]<<4)); 116 | font.printStr(ALIGN_CENTER,y+1,scrollTxt[t]); 117 | if(++c>=sizeof(bgCols)/sizeof(bgCols[0])) c=0; 118 | if(++t>=sizeof(scrollTxt)/sizeof(scrollTxt[0])) t=0; 119 | } 120 | while(millis()-ms<25); 121 | } 122 | } 123 | 124 | -------------------------------------------------------------------------------- /keywords.txt: -------------------------------------------------------------------------------- 1 | Arduino_ST7735 KEYWORD3 2 | 3 | init KEYWORD2 4 | invertDisplay KEYWORD2 5 | partialDisplay KEYWORD2 6 | sleepDisplay KEYWORD2 7 | enableDisplay KEYWORD2 8 | idleDisplay KEYWORD2 9 | resetDisplay KEYWORD2 10 | setScrollArea KEYWORD2 11 | setScroll KEYWORD2 12 | setPartArea KEYWORD2 13 | powerSave KEYWORD2 14 | rgbWheel KEYWORD2 15 | RGBto565 KEYWORD2 16 | drawImage KEYWORD2 17 | drawImageF KEYWORD2 18 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=Fast ST7735 Library 2 | version=1.0.1 3 | author=Pawel A. Hernik 4 | maintainer=Pawel A. Hernik 5 | sentence=Fast SPI library for ST7735 128x160 LCD 6 | paragraph=Fast SPI library for ST7735 128x160 LCD 7 | category=Display 8 | url=https://github.com/cbm80amiga/Arduino_ST7735_Fast 9 | architectures=* 10 | --------------------------------------------------------------------------------