Created
December 17, 2015 22:13
-
-
Save polygondoor/d59266cfee09c5907ecb to your computer and use it in GitHub Desktop.
animation Play 1
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 <Adafruit_SSD1306.h> | |
#define OLED_RESET 4 | |
Adafruit_SSD1306 display(OLED_RESET); | |
void setup() { | |
// tell the little OLED screen that we are 128 x 32 pixels | |
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // dont worry about this line, it looks complex | |
// set text size and other things | |
display.setTextSize(1); | |
display.setTextColor(WHITE); | |
display.setTextWrap(1); | |
// Tell the Arduino that pin 3 is an input pin. | |
pinMode(3, INPUT); | |
} | |
void loop() { | |
display.clearDisplay(); | |
drawBitMap(60,0); | |
// send info to display | |
display.display(); | |
} | |
static const unsigned char PROGMEM icon_bmp[] = | |
{ B00000000, B00000000, // 0 | |
B00000000, B00000000, // 1 | |
B00000000, B01100000, // 2 | |
B00000000, B01110000, // 3 | |
B00000000, B11110000, // 4 | |
B00000001, B11110000, // 5 | |
B00001111, B11100000, // 6 | |
B00011111, B11110000, // 7 | |
B00011111, B10111000, // 8 | |
B00011111, B00111000, // 9 | |
B00011000, B00011000, // 10 | |
B00000000, B00111000, // 11 | |
B00000001, B11110000, // 12 | |
B00000000, B00000000, // 13 | |
B00000000, B00000000, // 14 | |
B00000000, B00000000 // 15 | |
}; | |
void drawBitMap(int x, int y) | |
{ | |
display.drawBitmap(x, y, icon_bmp, 16, 16, 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment