#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
//Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
Adafruit_SSD1306 display(OLED_RESET);
#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 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};
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};
void setup() {
// Serial.begin(9600);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
// Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
}
void loop()
{
display.clearDisplay();
display.drawBitmap(0,16,zhe,charw,charh,WHITE);
display.drawBitmap(16,16,da,charw,charh,WHITE);
display.drawBitmap(32,16,ning,charw,charh,WHITE);
display.drawBitmap(48,16,bo,charw,charh,WHITE);
display.drawBitmap(64,16,li,charw,charh,WHITE);
display.drawBitmap(80,16,gong,charw,charh,WHITE);
display.drawBitmap(96,16,xue,charw,charh,WHITE);
display.drawBitmap(112,16,yuan,charw,charh,WHITE);
display.display();
delay(2000);
display.clearDisplay();
}