Skip to content

Instantly share code, notes, and snippets.

@tgfuellner
Last active May 26, 2016 07:53
Show Gist options
  • Save tgfuellner/b9db599697eaf016e6197826624973e1 to your computer and use it in GitHub Desktop.
Save tgfuellner/b9db599697eaf016e6197826624973e1 to your computer and use it in GitHub Desktop.
Oled mit ESP8266 Wemos D1 mini
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Fonts/FreeSans24pt7b.h>
// No IO Pin for Reset nedded, if oled Res 100nF to ground and 10k to 3.3V
#define OLED_RESET -1
Adafruit_SSD1306 display(OLED_RESET);
#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif
void setup() {
Serial.begin(9600);
// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
// init done
// Clear the buffer.
display.clearDisplay();
// text display tests
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("Hello, world!");
display.setTextSize(1);
display.setTextColor(WHITE);
display.setFont(&FreeSans24pt7b);
display.setCursor(5,32);
display.print(" 2:83");
display.display();
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment