/************************************************************************** This is an example for our Monochrome OLEDs based on SSD1306 drivers Pick one up today in the adafruit shop! ------> http://www.adafruit.com/category/63_98 This example is for a 128x64 pixel display using I2C to communicate 3 pins are required to interface (two I2C and one reset). Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried/Ladyada for Adafruit Industries, with contributions from the open source community. BSD license, check license.txt for more information All text above, and the splash screen below must be included in any redistribution. **************************************************************************/ #include #include #include #include #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) // The pins for I2C are defined by the Wire-library. // On an arduino UNO: A4(SDA), A5(SCL) // On an arduino MEGA 2560: 20(SDA), 21(SCL) // On an arduino LEONARDO: 2(SDA), 3(SCL), ... #define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin) #define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); #define NUMFLAKES 1 // Number of snowflakes in the animation example #define LOGO_HEIGHT 64 #define LOGO_WIDTH 64 // 'Fab_Lab_logo-01', 64x64px //// 'Logo LATE 2021-01', 64x64px const unsigned char epd_bitmap_Logo_LATE_2021_01 [] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x38, 0x01, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x38, 0x03, 0xf0, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x78, 0x03, 0xf0, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x70, 0x07, 0xf0, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x70, 0x07, 0xf0, 0x00, 0x1f, 0xfe, 0x00, 0x00, 0xf0, 0x0f, 0x70, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0xf0, 0x0e, 0x70, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0xe0, 0x1e, 0x70, 0x00, 0x3c, 0x00, 0x00, 0x01, 0xe0, 0x3c, 0x70, 0x00, 0x3c, 0x00, 0x00, 0x01, 0xe0, 0x3c, 0x70, 0x00, 0x38, 0x00, 0x00, 0x01, 0xe0, 0x78, 0x70, 0x00, 0x78, 0x00, 0x00, 0x03, 0xc0, 0x70, 0x70, 0x00, 0x78, 0x00, 0x00, 0x03, 0xc0, 0xf0, 0x78, 0x00, 0x78, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xc0, 0x78, 0x78, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x70, 0x78, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x70, 0x78, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x70, 0x70, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x70, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; int x = 0; void setup() { Serial.begin(9600); // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) { Serial.println(F("SSD1306 allocation failed")); for (;;); // Don't proceed, loop forever } } void loop() { // Clear the buffer //display.clearDisplay(); // Draw a single pixel in white for (int i = 0; i < SCREEN_HEIGHT; i++) { display.drawPixel(x, i, SSD1306_WHITE); } // Show the display buffer on the screen. You MUST call display() after // drawing commands to make them visible on screen! display.display(); x++; delay(2); if (x > SCREEN_WIDTH) { testdrawbitmap(); delay(5000); display.clearDisplay(); x = 0; } } void testdrawbitmap(void) { display.clearDisplay(); display.drawBitmap( (display.width() - LOGO_WIDTH ) / 2, (display.height() - LOGO_HEIGHT) / 2, epd_bitmap_Logo_LATE_2021_01, LOGO_WIDTH, LOGO_HEIGHT, 1); display.display(); delay(1000); }