#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
// 浙大宁波理工学院 字模点阵 宋体12 每个字16像素*16像素
/*--文字:浙--宽x高=16x16 */
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};
/*-- 文字: 大--宽x高=16x16 */
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};
/*-- 文字: 宁--宽x高=16x16 */
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};
/*-- 文字: 波--宽x高=16x16 */
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};
/*-- 文字: 理--宽x高=16x16 */
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};
/*-- 文字: 工 --宽x高=16x16 */
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};
/*-- 文字: 学--宽x高=16x16 */
static const unsigned char PROGMEM xue[]={ 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};
/*-宋体12- 文字: 院--宽x高=16x16 */
static const unsigned char PROGMEM yuan[]={ 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 *hanzi[]={zhe,da,ning,bo,li,gong,xue,yuan};
static const unsigned char PROGMEM gu[]={ 0x00,0x00,0x7E,0xFE,0x40,0x20,0x40,0x40,0x5E,0xFC,0x52,0x84,0x52,0x94,0x52,0x94,
0x5A,0x94,0x54,0x94,0x50,0x94,0x52,0xA4,0x54,0x30,0x58,0x48,0x50,0x84,0x83,0x02};
static const unsigned char PROGMEM yi[]={ 0x08,0x00,0x0B,0xF8,0x08,0x88,0x10,0x88,0x10,0x88,0x37,0xFE,0x30,0x88,0x50,0x88,
0x90,0x88,0x13,0xF8,0x10,0x88,0x10,0x80,0x11,0x00,0x11,0x00,0x12,0x00,0x14,0x00,};
static const unsigned char PROGMEM rui[]={ 0x08,0x20,0x08,0x20,0xFF,0xFE,0x08,0x20,0x08,0x20,0x01,0x00,0x24,0x88,0x24,0x24,
0x43,0xE4,0x00,0x00,0x24,0x24,0x12,0x12,0xA0,0xA0,0xA4,0xA4,0x1C,0x1C,0x00,0x00,};
static const unsigned char *mingzi[]={gu,yi,rui};
void setup() {
// put your setup code here, to run once:
display.begin(SSD1306_SWITCHCAPVCC,0x3C); //初始化IIC地址
delay(10);
}
void loop() {
// put your main code here, to run repeatedly:
{
display.clearDisplay();
for(int i=0;i<=7;i++)
display.drawBitmap(i*16,5,hanzi[i],charw,charh,WHITE);
for(int j=0;j<=3;j++)
display.drawBitmap(j*16,25,mingzi[j],charw,charh,WHITE);
display.display();
delay(2000);
display.clearDisplay();}
}