//Panos Papazoglou, MICRODEV.GR #include #include #include #include #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_DC 8 #define OLED_CS 10 #define OLED_RESET 9 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, OLED_DC, OLED_RESET, OLED_CS); void setup() { Serial.begin(9600); if(!oled.begin(SSD1306_SWITCHCAPVCC)) { Serial.println(F("SSD1306 Error")); for(;;); } oled.clearDisplay(); oled.display(); oled.clearDisplay(); mytext("hello",2,0,10); mytext("MICRODEV.",2,0,30); mytext("GR",1,107,35); } void loop() { } void mytext(String text, int textsize, int x, int y) { oled.setTextSize(textsize); oled.setTextColor(WHITE); oled.setCursor(x,y); oled.print(text); oled.display(); }