OLED SH1106 사용하다보니 라이브러리 중에 Adafruit_SH110X가

있어서 사용해보자.

 

#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>

Adafruit_SH1106G display(128, 64, &Wire, -1);

void setup() {
  Wire.begin();
  display.begin(0x3C, true); // reset = true
  display.clearDisplay();

  display.setTextSize(1);
  display.setTextColor(SH110X_WHITE);
  display.setCursor(0, 0);
  display.println("SH1106 OK");
  display.display();
}

void loop() {}
728x90

+ Recent posts