/* This Arduino sketch shows QR-code with word 'AMAZING' and a heart in the right side of GLCD-display. Library openGLCD https://bitbucket.org/bperrybap/openglcd/wiki/Home is used. Author: Maxim Logunov spitty.pnz@gmail.com Date: 2016-12-17 */ #include #define RECTSIZE 21 #define PXSIZE 2 const int bits[RECTSIZE][RECTSIZE] = {{0,0,0,0,0,0,0,1,0,1,1,0,1,1,0,0,0,0,0,0,0}, {0,1,1,1,1,1,0,1,1,0,1,1,0,1,0,1,1,1,1,1,0}, {0,1,0,0,0,1,0,1,1,0,1,1,1,1,0,1,0,0,0,1,0}, {0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0}, {0,1,0,0,0,1,0,1,1,1,1,0,1,1,0,1,0,0,0,1,0}, {0,1,1,1,1,1,0,1,1,0,1,0,0,1,0,1,1,1,1,1,0}, {0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,1,0,1,0,0,1,1,0,0,1,0,0,1,1,1,1,0,1,1,0}, {1,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,1}, {0,1,1,1,0,1,1,0,0,0,0,0,0,0,1,1,0,0,1,1,1}, {1,0,1,1,1,0,1,1,0,0,0,0,0,1,1,1,1,1,0,1,1}, {0,0,0,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,0,0,1}, {1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,0,0,1,1}, {0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1}, {0,1,1,1,1,1,0,1,0,0,1,1,0,0,0,0,0,1,0,1,0}, {0,1,0,0,0,1,0,1,0,1,1,1,1,0,1,0,1,0,0,1,0}, {0,1,0,0,0,1,0,1,1,1,0,0,1,1,0,0,1,0,1,0,1}, {0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,1,0,1,0}, {0,1,1,1,1,1,0,1,1,0,0,1,1,0,0,0,1,1,1,0,0}, {0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,0,0,0,1,0}}; void setup() { GLCD.Init(); GLCD.ClearScreen(); } void loop() { for (int i = 0; i < RECTSIZE; i++) { for (int j = 0; j < RECTSIZE; j++) { uint8_t color = (bits[i][j] == 0 ? PIXEL_ON : PIXEL_OFF); // padding-top : 11 = (64 - RECTSIZE * PXSIZE) / 2 // padding-left : 75 = WIDTH / 2 + (64 - RECTSIZE * PXSIZE) / 2 GLCD.FillRect(75 + j * PXSIZE, 11 + i * PXSIZE, 2, 2, color); } } delay(1000); }