Apophis171

Untitled

Sep 22nd, 2020
1,011
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <SPI.h>
  2. #include <Wire.h>
  3. #include <Adafruit_GFX.h>
  4. #include <Adafruit_SSD1306.h>
  5.  
  6. Adafruit_SSD1306 display(-1);
  7.  
  8. void setup(){
  9.   Serial.begin(115200);
  10.  
  11.   display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  
  12.   display.setRotation(2);
  13.   display.clearDisplay();
  14. }
  15.  
  16. void loop(){
  17.   display.clearDisplay();
  18.   display.setTextSize(1);
  19.   display.setTextColor(WHITE);
  20.  
  21.   display.drawLine(0, 18, 128,18, WHITE);
  22.   display.setCursor(0,0);
  23.   display.print("foo bar");
  24.  
  25.   display.display();
  26. }
RAW Paste Data