0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ATOMS3 Liteで有機ELで遊ぶ。(SSD1306)(I2C)

Last updated at Posted at 2025-10-20

参考

Screenshot from 2025-10-21 06-38-36.png

いろいろ注意

  • 過去ログを見よ!!!
  • 各自、データシート確認の事
  • やや、ヒット
  • 秋月のOLED(白)を買って来て、ポン付けで出来る(半田付けなし
  • M5Stackの国内の取り扱いの本家は、スイッチサイエンスなので、そこで手に入る
  • なぜか、価格差がほとんど、なくったので、パッケージ(ケース)に入っているをセレクト
  • 後出し、だけど、買う前からOLEDが動きそうなのは、予想していた

結果

Screenshot from 2025-10-21 06-48-18.png

プログラム



//I2C_SSD1306_CHAR_ATOMS3_1


//ヘッダーファイル
#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>


//定義
#define SCREEN_WIDTH 128     // OLED display width, in pixels
#define SCREEN_HEIGHT 64     // OLED display height, in pixels
#define OLED_RESET -1        // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C  ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);


//初期化
void setup() {

  //I2Cのポートの変更
  Wire.begin(39, 38);  //M5ATOMS3

  // I2Cアドレスは使用するディスプレイに合わせて変更する
  display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS);

}  //setup


//メインループ
void loop() {

  // 画面表示をクリア
  display.clearDisplay();

  // テキストサイズを設定
  display.setTextSize(3);
  // テキスト色を設定
  display.setTextColor(WHITE);
  // テキストの開始位置を設定
  display.setCursor(0, 10);


  // 1行目にG030を表示
  display.println("ATOMS3");

  // 描画バッファの内容を画面に表示
  display.display();

  delay(1000);  //1秒待つ

}  //loop



0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?