Skip to content

Instantly share code, notes, and snippets.

#include <M5Stack.h>
#define LED_PIN 16 // 16番ピンにLED接続
void setup() {
M5.begin(); // Initialize the M5Stack object
pinMode(LED_PIN, OUTPUT);
}
// Add the main program code into the continuous loop() function
void loop() {
#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() {