Created
December 30, 2018 13:14
-
-
Save thomasstr/17387f2416d48771b1109e196fd4ca15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Hello World OLED Test */ | |
#include "SSD1306.h" // alias for `#include "SSD1306Wire.h"` | |
SSD1306 display(0x3c, 4, 5); // Initialise the OLED display using Wire library (D2 and D1 on NodeMCU) | |
void setup() | |
{ | |
Serial.begin(9600); | |
display.init(); // Initialising the UI will init the display too. | |
display.flipScreenVertically(); | |
display.normalDisplay(); | |
display.clear(); | |
drawHelloWorld(); | |
display.display(); | |
} | |
void loop() | |
{ | |
} | |
void drawHelloWorld() | |
{ | |
display.setTextAlignment(TEXT_ALIGN_LEFT); | |
display.setFont(ArialMT_Plain_10); | |
display.drawString(0, 0, "Hello world"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment