Skip to content

Instantly share code, notes, and snippets.

@Drunkar
Created May 2, 2017 07:28
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 Drunkar/66899717e2fbb6ba6cb29819409ec229 to your computer and use it in GitHub Desktop.
Save Drunkar/66899717e2fbb6ba6cb29819409ec229 to your computer and use it in GitHub Desktop.
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2
const int X_ZERO = 32;
const int Y_ZERO = 8;
const int H_CHAR = 8;
const int CHAR_SIZE = 1;
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop() {
display.clearDisplay();
display.setTextSize(CHAR_SIZE);
display.setTextColor(WHITE);
display.setCursor(X_ZERO, Y_ZERO);
display.println("Hello");
display.setCursor(X_ZERO, Y_ZERO+(H_CHAR*CHAR_SIZE));
display.println("World!");
display.setCursor(X_ZERO, Y_ZERO+(H_CHAR*CHAR_SIZE)*2);
display.println(millis());
display.display();
delay(10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment