Advertisement
hwthinker

NodemcuOLED-esp8266

Mar 27th, 2018
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Wire.h>  // Only needed for Arduino 1.6.5 and earlier
  2. #include "SSD1306Wire.h" // legacy include: `#include "SSD1306.h"`
  3. SSD1306Wire  display(0x3c, D1, D2);
  4.  
  5.  
  6. void setup() {
  7.   display.init();
  8.   display.flipScreenVertically();
  9. }
  10.  
  11. void loop() {
  12.     display.setTextAlignment(TEXT_ALIGN_LEFT);
  13.     display.setFont(ArialMT_Plain_10);
  14.     display.drawString(0, 0, "hwThinker");
  15.     display.display();
  16.     delay(1000);
  17.     display.clear();
  18.  
  19.     display.setFont(ArialMT_Plain_16);
  20.     display.drawString(0, 10, "HwThinker");
  21.     display.setFont(ArialMT_Plain_24);
  22.     display.drawString(0, 26, "inAction");
  23.     display.display();
  24.     delay(1000);
  25.     display.clear();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement