Skip to content

Instantly share code, notes, and snippets.

@cynthiahenaff
Last active March 1, 2020 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cynthiahenaff/34bda3b4f0d0d942f7ce72c729541809 to your computer and use it in GitHub Desktop.
Save cynthiahenaff/34bda3b4f0d0d942f7ce72c729541809 to your computer and use it in GitHub Desktop.
Oled Display
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(-1);
void setup() {
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 64x48)
// init done
// set the text size and color
display.setTextSize(2);
display.setTextColor(WHITE);
}
void loop() {
display.setCursor(0,0);
display.println("Hello");
display.display();
delay(1000);
display.clearDisplay();
display.setCursor(0,24);
display.println("World");
display.display();
delay(1000);
display.clearDisplay();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment