Code: Select all
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
#define SSD1306_NO_SPLASH
#define OLED_RESET -1 // 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);
Code: Select all
## Changes
Pull Request:
(November 2021)
* Added define `SSD1306_NO_SPLASH` to opt-out of including splash images in `PROGMEM` and drawing to display during `begin`.
Adafruit_SSD1306.cpp says:
Code: Select all
#ifndef SSD1306_NO_SPLASH
if (HEIGHT > 32) {
drawBitmap((WIDTH - splash1_width) / 2, (HEIGHT - splash1_height) / 2,
splash1_data, splash1_width, splash1_height, 1);
} else {
drawBitmap((WIDTH - splash2_width) / 2, (HEIGHT - splash2_height) / 2,
splash2_data, splash2_width, splash2_height, 1);
}
#endif
splash.h says:
Code: Select all
/**
* This file is autogenerated, do not edit.
* Run `make` from the scripts directory to produce splash.h
*
* Splashes will be stored in PROGMEM (flash).
* If SSD1306_NO_SPLASH is defined, the splashes are omitted.
*/
#ifndef SSD1306_NO_SPLASH
/* clang-format off */
#define splash1_width 82
#define splash1_height 64
const uint8_t PROGMEM splash1_data[] = {
**lots of pretty bitmap data**
};
/* clang-format on */
#endif
Code: Select all
// Uncomment to disable Adafruit splash logo
// #define SSD1306_NO_SPLASH