3 changed files with 29 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||||
|
#include <Wire.h> |
||||
|
#include <Adafruit_GFX.h> |
||||
|
#include <Adafruit_SSD1306.h> |
||||
|
#include "extDisplay.h" |
||||
|
|
||||
|
#define EXT_DISPLAY_I2C_ADDRESS 0x3C |
||||
|
#define EXT_SCREEN_WIDTH 128 |
||||
|
#define EXT_SCREEN_HEIGHT 64 |
||||
|
|
||||
|
|
||||
|
Adafruit_SSD1306 extDisplay(EXT_SCREEN_WIDTH, EXT_SCREEN_HEIGHT, &Wire, -1); |
||||
|
|
||||
|
void initExtDisplay() { |
||||
|
Wire.begin(EXT_I2C_SDA, EXT_I2C_SCL); |
||||
|
if(!extDisplay.begin(SSD1306_SWITCHCAPVCC, EXT_DISPLAY_I2C_ADDRESS)) { |
||||
|
//Serial.println("SSD1306 #1 allocation failed");
|
||||
|
for(;;); |
||||
|
} |
||||
|
|
||||
|
extDisplay.clearDisplay(); |
||||
|
extDisplay.fillScreen(WHITE); |
||||
|
extDisplay.display(); |
||||
|
} |
||||
@ -0,0 +1,4 @@ |
|||||
|
#define EXT_I2C_SDA 21 |
||||
|
#define EXT_I2C_SCL 5 |
||||
|
|
||||
|
void initExtDisplay(); |
||||
Loading…
Reference in new issue