#include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define OLED_RESET 4 Adafruit_SSD1306 display(OLED_RESET); //put the bitmap here. const unsigned char PROGMEM radar1 [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x3F, 0xFC, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x01, 0xC7, 0xE3, 0x80, 0x03, 0x18, 0x18, 0xC0, 0x06, 0x60, 0x06, 0x60, 0x0C, 0x8E, 0x71, 0x30, 0x0D, 0x90, 0x08, 0xB0, 0x03, 0xE7, 0xE4, 0x98, 0x00, 0x78, 0x12, 0x58, 0x30, 0x1B, 0xC9, 0x4C, 0x1E, 0x0F, 0xE5, 0x2C, 0x07, 0x84, 0x75, 0x2C, 0xFF, 0xFF, 0xB4, 0x2C, 0x00, 0x41, 0xB4, 0x2C, 0x15, 0xAE, 0x75, 0x2C, 0x14, 0xA7, 0xE5, 0x2C, 0x32, 0x93, 0xC9, 0x4C, 0x1A, 0x48, 0x12, 0x58, 0x19, 0x27, 0xE4, 0x98, 0x0D, 0x10, 0x08, 0xB0, 0x0C, 0x8E, 0x71, 0x30, 0x06, 0x60, 0x06, 0x60, 0x03, 0x18, 0x18, 0xC0, 0x01, 0xC7, 0xE3, 0x80, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x3F, 0xFC, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; #if(SSD1306_LCDHEIGHT !=32) #error("Height incorrect,please fix Adafruit_SSD1306.h!"); #endif void setup() { Serial.begin(9600); } void loop() { display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32) display.clearDisplay(); display.drawBitmap(20,0,radar1,32,32,WHITE); display.display(); delay(2000); } |