Added support for SH1106

OLED_DISPLAY_SH1106
This commit is contained in:
Austin St. Aubin 2018-10-06 23:19:13 -05:00
parent f24dfe9d23
commit a43eaa6d64
2 changed files with 21 additions and 5 deletions

View File

@ -114,10 +114,11 @@
#define ESP_DHT_PIN 2
#endif
//Pins where the screen is connected
//Pins where the screen is connected
#ifdef ESP_OLED_FEATURE
#define OLED_PIN_A 4
#define OLED_PIN_B 15
#define OLED_DISPLAY_SH1106 // OLED Display Type: SSD1306(OLED_DISPLAY_SSD1306) / SH1106(OLED_DISPLAY_SH1106), comment this line out to disable oled
#define OLED_PIN_A 5 //5 //SDA; // i2c SDA Pin
#define OLED_PIN_B 4 //4 //SCL; // i2c SCL Pin
#define OLED_ADDR 0x3c
#define HELTEC_EMBEDDED_PIN 16 //0 to disable
#define OLED_FLIP_VERTICALY 1 //0 to disable

View File

@ -20,9 +20,24 @@
#include "config.h"
#ifdef ESP_OLED_FEATURE
#include "esp_oled.h"
#include "SSD1306.h"
#include "Wire.h"
SSD1306 esp_display(OLED_ADDR, OLED_PIN_A, OLED_PIN_B);
// Initialize the OLED display using I2C
#ifdef OLED_DISPLAY_SSD1306
#include "SSD1306.h" // alias for `#include "SSD1306Wire.h"`
#elif defined OLED_DISPLAY_SH1106
#include "SH1106.h" // alias for `#include "SH1106Wire.h"`
#endif
#ifdef OLED_DISPLAY_SSD1306
SSD1306 esp_display(0x3c, OLED_PIN_A, OLED_PIN_B);
#elif defined OLED_DISPLAY_SH1106
SH1106 esp_display(0x3c, OLED_PIN_A, OLED_PIN_B);
#endif
#define ESP3D_Logo_width 62
#define ESP3D_Logo_height 45
const char ESP3D_Logo[] PROGMEM = {