#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 64, &Wire);
#define charw 16
#define charh 16
static const unsigned char PROGMEM zhe[]={0x02,0x08,0x42,0x1C,0x22,0x60,0x22,0x40,0x0F,0xC0,0x82,0x40,0x42,0x7E,0x52,0xC8,
0x13,0x48,0x2E,0x48,0xE2,0x48,0x22,0x48,0x22,0x48,0x22,0x48,0x2A,0x88,0x05,0x08};
static const unsigned char PROGMEM da[]={0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,0x01,0x00,
0x02,0x80,0x02,0x80,0x04,0x40,0x04,0x40,0x08,0x20,0x10,0x10,0x20,0x08,0xC0,0x06};
static const unsigned char PROGMEM ning[]={0x02,0x00,0x01,0x00,0x01,0x00,0x7F,0xFE,0x40,0x02,0x80,0x04,0x00,0x00,0x3F,0xF8,
0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x00};
static const unsigned char PROGMEM bo[]={0x00,0x20,0x20,0x20,0x10,0x20,0x13,0xFE,0x82,0x22,0x42,0x24,0x4A,0x20,0x0B,0xFC,
0x12,0x84,0x12,0x88,0xE2,0x48,0x22,0x50,0x22,0x20,0x24,0x50,0x24,0x88,0x09,0x06};
static const unsigned char PROGMEM li[]={0x00,0x00,0x01,0xFC,0xFD,0x24,0x11,0x24,0x11,0xFC,0x11,0x24,0x11,0x24,0x7D,0xFC,
0x10,0x20,0x10,0x20,0x11,0xFC,0x10,0x20,0x1C,0x20,0xE0,0x20,0x43,0xFE,0x00,0x00};
static const unsigned char PROGMEM gong[]={0x00,0x00,0x00,0x00,0x7F,0xFC,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,
0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x00,0x00,0x00,0x00};
static const unsigned char PROGMEM xue2[]={0x22,0x08,0x11,0x08,0x11,0x10,0x00,0x20,0x7F,0xFE,0x40,0x02,0x80,0x04,0x1F,0xE0,
0x00,0x40,0x01,0x80,0xFF,0xFE,0x01,0x00,0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x00};
static const unsigned char PROGMEM yuan2[]={0x00,0x40,0x78,0x20,0x4B,0xFE,0x52,0x02,0x54,0x04,0x61,0xF8,0x50,0x00,0x48,0x00,
0x4B,0xFE,0x48,0x90,0x68,0x90,0x50,0x90,0x41,0x12,0x41,0x12,0x42,0x0E,0x44,0x00};
static const unsigned char *xuexiao[ ]={zhe,da,ning,bo,li,gong,xue2,yuan2};
#define bitmap_width 128
#define bitmap_height 64
static const unsigned char PROGMEM bitmap_logo[] = {0x00,0x78,0x00,0x7F,0xE1,0x83,0xFE,0x00,0x1E,0x00,0x1F,0xFB,0x00,
0x01,0x87,0x9E,0x00,0xE0,0x01,0xC1,0xFF,0xFF,0x83,0x80,0x07,0x81,0xBF,0x0D,0x80,
0x03,0x07,0xDF,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x3F,0xFE,0x00,0x00,0x3F,0xFC,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x07,0xFC,0x00,0x00,0x00,0x80,0x3F,0xE0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7F,0x00,0x18,0x00,0x00,0xF0,0x00,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xF0,0x00,0x0B,0xC0,0x00,0x3F,0xE0,0x0F,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0x1F,0x00,0x1C,0x7F,0x00,0x07,0xFF,0xFE,0x00,0xF8,0x00,0x00,0x00,
0x00,0x00,0x00,0xF8,0x00,0x01,0xFE,0x00,0x03,0x8B,0xDF,0x00,0x1F,0x00,0x00,0x00,
0x00,0x00,0x03,0xD3,0xC0,0x38,0xFF,0x9E,0x03,0x0F,0xE0,0x00,0x03,0xC0,0x00,0x00,
0x00,0x00,0x0F,0x77,0x80,0x1E,0xC4,0xFE,0x02,0x07,0x00,0x03,0x00,0xF0,0x00,0x00,
0x00,0x00,0x38,0x1F,0xC0,0x1E,0x80,0x00,0x00,0x07,0x80,0x41,0xC0,0x1C,0x00,0x00,
0x00,0x00,0xE0,0xB7,0xFC,0x00,0x01,0xFF,0xFF,0x80,0x00,0x7F,0xC0,0x07,0x00,0x00,
0x00,0x03,0x80,0xDB,0xE0,0x00,0x7F,0xFF,0xFF,0xFF,0x00,0x1F,0xE0,0x01,0xC0,0x00,
0x00,0x07,0x00,0x07,0xE0,0x0F,0xE0,0x3F,0xFC,0x07,0xF0,0x00,0xF0,0x00,0xE0,0x00,
0x00,0x1C,0x00,0x06,0x30,0x7C,0x01,0xF9,0x9F,0x80,0x3E,0x00,0x30,0x00,0x38,0x00,
0x00,0x38,0x00,0x0C,0x33,0xCF,0x07,0x31,0x8C,0xE0,0xF3,0xC0,0x00,0xC3,0x9C,0x00,
0x00,0x60,0xC0,0x00,0x0E,0x01,0xFC,0x61,0x86,0x3F,0x80,0x78,0x03,0xBF,0xC6,0x00,
0x00,0xCF,0x80,0x03,0x80,0x03,0x03,0x01,0x80,0xC0,0xC0,0x01,0xC3,0xFB,0x80,0xC0,
0x06,0x0F,0xE0,0x0E,0x00,0x0C,0x06,0x01,0x80,0x60,0x30,0x00,0x73,0x61,0xC0,0x60,
0x0C,0x0C,0x30,0x18,0x00,0x18,0x04,0x01,0x80,0x20,0x18,0x00,0x18,0x00,0xC0,0x30,
0x18,0x00,0x10,0x3F,0x00,0x60,0x08,0x01,0x80,0x10,0x06,0x00,0xFC,0x00,0x00,0x18,
0x18,0x00,0x00,0x67,0xF0,0xC0,0x18,0x0F,0xFC,0x18,0x03,0x3F,0xE6,0x00,0x00,0x1C,
0x31,0x80,0x00,0xC3,0xFF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60,0x0E,0x03,0x00,0x0C,0x03,0xFF,0xFF,0xFF,0xFE,0x00,0x30,0x00,0xC0,0x70,0x06,
0x63,0xFE,0x01,0x80,0x06,0x00,0x27,0xFF,0xFF,0x84,0x00,0x60,0x01,0x80,0x1C,0x06,
0x73,0xBB,0x01,0x80,0x03,0x03,0xFF,0xFF,0xFF,0xFF,0xC0,0xC0,0x01,0x80,0xFF,0x8E,
0x30,0xFF,0x00,0xC0,0x01,0xFF,0x7F,0xFF,0xFF,0xE8,0xFF,0x80,0x03,0x01,0x80,0x0C,
0x18,0xE3,0xC0,0x60,0x0F,0xC0,0x3F,0xFF,0xFF,0x98,0x03,0xF0,0x06,0x03,0xC0,0x1C,
0x18,0x3F,0x20,0x31,0xF8,0x60,0x3F,0xFF,0xFE,0x10,0x06,0x1F,0x8C,0x06,0xFE,0x18,
0x0C,0x71,0xE0,0x1F,0x80,0x38,0x04,0xFF,0xC0,0x30,0x1C,0x00,0xF8,0x0C,0x0E,0x30,
0x06,0x0F,0xCC,0x0E,0x00,0x0C,0x07,0xFF,0xF0,0x60,0x30,0x00,0x70,0x07,0xC0,0x60,
0x03,0x19,0xFC,0x03,0x80,0x07,0x07,0xFF,0xE0,0xC0,0xE0,0x01,0xC0,0x78,0xF0,0xC0,
0x01,0x83,0xCF,0x80,0xE0,0x01,0xC3,0xFF,0x81,0x83,0x80,0x07,0x80,0x6F,0x81,0x80,
0x00,0xC2,0x3C,0xC0,0x78,0x00,0x77,0xFF,0xFF,0xEE,0x00,0x1E,0x03,0x39,0x83,0x00,
0x00,0x60,0x65,0x90,0x1E,0x00,0x7D,0xFD,0x86,0x3E,0x00,0x78,0x0F,0xC7,0x86,0x00,
0x00,0x38,0x7E,0x7C,0x03,0xC7,0xC7,0xF9,0x8C,0xE3,0xE3,0xC0,0x6E,0xF8,0x1C,0x00,
0x00,0x1C,0x18,0xE6,0x00,0x7C,0x01,0xF9,0x9B,0x80,0x3E,0x01,0xE3,0xBC,0x38,0x00,
0x00,0x07,0x03,0xBD,0xF0,0x0F,0xE0,0x3D,0xBC,0x07,0xF0,0x0D,0xD8,0xE0,0xE0,0x00,0x00,0x03,0x81,0xF3,0x9A,0x00,0x7F,0xFF,0xFF,0xFE,0x00,0x46,0x63,0x01,0xC0,0x00,
0x00,0x00,0xE0,0x06,0x33,0xE0,0x01,0xFF,0xFF,0x80,0x03,0xF6,0x3E,0x07,0x00,0x00,
0x00,0x00,0x38,0x06,0xE1,0xAF,0x00,0x00,0x00,0x00,0x1B,0x1F,0x08,0x1C,0x00,0x00,
0x00,0x00,0x0F,0x03,0xC3,0x0B,0x9E,0x10,0x01,0x89,0xD9,0x87,0x00,0xF0,0x00,0x00,
0x00,0x00,0x03,0xC0,0x06,0x1F,0x33,0x62,0x00,0xCD,0xFC,0xE0,0x03,0xC0,0x00,0x00,
0x00,0x00,0x00,0xF8,0x0C,0x31,0x61,0x7E,0x00,0xCC,0xDE,0x60,0x1F,0x00,0x00,0x00,
0x00,0x00,0x00,0x1F,0x00,0x3E,0x66,0x7E,0x00,0xC4,0x66,0x00,0xF8,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xF0,0x00,0x3E,0x66,0x00,0x7C,0x00,0x0F,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x46,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x07,0xFC,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x3F,0xFE,0x00,0x00,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00};
void setup(){
display.begin(SSD1306_SWITCHCAPVCC,0x3C);}
void loop(){
display.clearDisplay();
for(int j=0;j<=8;j++)
display.drawBitmap(j*16,17,xuexiao[j],charw,charh,WHITE);
display.display();
delay(1000);
display.clearDisplay(); //清理缓存
Logo_display(); //显示图片
}
void Logo_display()
{
display.clearDisplay(); //清理缓存
display.drawBitmap(0,0, bitmap_logo,bitmap_width,bitmap_height,WHITE);
//从0行,0列开始到128行,64列显示logo,颜色为白色
display.display(); //显示缓存内容
delay(1000); //延时
}