#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // Screen width in pixels
#define SCREEN_HEIGHT 64 // Screen height in pixels
#define OLED_RESET -1 // reset pin (-1 = Arduino Reset Pin)
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); // Initiate the display
#define LOGO_HEIGHT 16
#define LOGO_WIDTH 16
static const unsigned char PROGMEM logo_bmp[] =
{ 0b00000000, 0b11000000,
0b00000001, 0b11000000,
0b00000001, 0b11000000,
0b00000011, 0b11100000,
0b11110011, 0b11100000,
0b11111110, 0b11111000,
0b01111110, 0b11111111,
0b00110011, 0b10011111,
0b00011111, 0b11111100,
0b00001101, 0b01110000,
0b00011011, 0b10100000,
0b00111111, 0b11100000,
0b00111111, 0b11110000,
0b01111100, 0b11110000,
0b01110000, 0b01110000,
0b00000000, 0b00110000
};
void setup() {
Serial.begin(9600);
if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
// display.clearDisplay();
// display.display();
// display.drawPixel(10, 10, WHITE);
// display.drawPixel(10, 20, WHITE);
// display.drawPixel(20, 20, WHITE);
// display.drawPixel(20, 10, WHITE);
// display.display();
// delay(1000);
// display.clearDisplay();
// display.drawLine(10, 10, 10, 20, WHITE);
// display.drawLine(10, 20, 20, 20, WHITE);
// display.drawLine(20, 20, 20, 10, WHITE);
// display.drawLine(20, 10, 10, 10, WHITE);
// display.display();
// delay(1000);
// display.clearDisplay();
// display.fillRect(10, 10, 11, 11, WHITE);
// display.display();
// delay(1000);
// display.clearDisplay();
// for (int r = 1; r <= 4; r++)
// {
// display.fillRoundRect(10, 10, 11, 11, r, WHITE);
// display.display();
// delay(10);
// display.clearDisplay();
// display.display();
// }
// for (int r = 5; r >= 0; r--)
// {
// display.fillCircle(15, 15, r, WHITE);
// display.display();
// delay(10);
// display.clearDisplay();
// display.display();
// }
// delay(1000);
// display.clearDisplay();
// display.drawChar(20, 20, 'A', WHITE, BLACK, 1);
// display.display();
// delay(1000);
display.clearDisplay();
display.setCursor(0, 0);
display.setTextColor(WHITE, BLACK);
display.setTextSize(1);
display.setTextWrap(true);
display.write("I would like to see how much of a sentance can this small tiny tine display fit?? Turns out it can fit a lot of it. \nWill this enter work ?? \t Tab?");
display.display();
}
void loop() {
}