#include #include #include #include #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for SSD1306 display connected using software SPI (default case): #define OLED_MOSI MOSI //Connect SSD1315 D1 #define OLED_CLK SCK //Connect SSD1315 D0 #define OLED_DC D4 //Connect SSD1315 D/C #define OLED_CS SS //Connect SSD1315 CS #define OLED_RESET D5 //Connect SSD1315 RES Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS); void setup() { Serial.begin(9600); if(!display.begin(SSD1306_SWITCHCAPVCC)) { Serial.println(F("SSD1306 allocation failed")); for(;;); // Don't proceed, loop forever } } void loop() { display.clearDisplay(); display.setTextSize(1); // Normal 1:1 pixel scale display.setTextColor(SSD1306_WHITE); // Draw white text display.setCursor(0,3); // Start at top-left corner display.println(F("Hello")); display.setTextSize(2); display.setCursor(0,16); display.println(F("Hello")); display.setTextSize(3); display.setCursor(0,38); display.println(F("Hello")); display.display(); delay(2000); }