1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| #include <SPI.h> #include <Adafruit\_GFX.h> #include <Adafruit\_PCD8544.h> #include <avr/pgmspace.h>
Adafruit_PCD8544 display = Adafruit\_PCD8544(7, 6, 5, 4, 3);
static const unsigned char PROGMEM logo16_glcd_bmp[] = { 0B00000000, 0B11000000, 0B00000001, 0B11000000, 0B00000001, 0B11000000, 0B00000011, 0B11100000, 0B11110011, 0B11100000, 0B11111110, 0B11111000, 0B01111110, 0B11111111, 0B00110011, 0B10011111, 0B00011111, 0B11111100, 0B00001101, 0B01110000, 0B00011011, 0B10100000, 0B00111111, 0B11100000, 0B00111111, 0B11110000, 0B01111100, 0B11110000, 0B01110000, 0B01110000, 0B00000000, 0B00110000 };
void setup(){ display.begin(); display.setContrast(50); delay(50); display.setCursor(0,0); display.setTextColor(WHITE, BLACK); display.setTextSize(1); display.print("Hello World"); display.display(); delay(1000); display.clearDisplay(); display.drawBitmap(0,0,logo16_glcd_bmp,16,16,BLACK); display.display(); }
void loop(){}
|