Created
May 2, 2017 07:28
-
-
Save Drunkar/66899717e2fbb6ba6cb29819409ec229 to your computer and use it in GitHub Desktop.
This file contains 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
#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