Skip to content

Instantly share code, notes, and snippets.

@takataka5614
Created March 19, 2020 09:44
Show Gist options
  • Save takataka5614/fa93ee42936774a7ad9e58fc31cec975 to your computer and use it in GitHub Desktop.
Save takataka5614/fa93ee42936774a7ad9e58fc31cec975 to your computer and use it in GitHub Desktop.
#include "Wire.h" //OLEDとI2C接続するためのライブラリを読み込む
#include "SSD1306.h" //OLEDとやり取りするためのライブラリを読み込む
#define SDA 22 //SDAをGPIOの22へ
#define SCL 18 //SCLをGPIOの18へ
SSD1306 display(0x3c, SDA, SCL); //0x3cはI2Cアドレス
void setup() {
display.init(); //ディスプレイを初期化
display.drawString(0, 0, "Hello World from ESP32!");
display.display(); //指定された文字を描く
}
void loop() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment