1
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?

M5NanoC6とOLED SSD1327で遊ぶ (「46」よろーを表示)(ESP32-C6)

Last updated at Posted at 2024-10-06

x 過去ログを見よ!!
x Adafruit_GFXとAdafruit_SSD1327をインストール
x M5Nano C6の事
x OLEDは、たぶん、秋月で買った

目的
OLEDで遊ぶ

結果

o_coq490.jpg

プログラム




//ssd1327_46_M6NanoC6_1


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

//定義
#define SCREEN_WIDTH  128    // OLED display width, in pixels
#define SCREEN_HEIGHT 96    // 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_SSD1327 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

#define setCursorAA(AA,BB) setCursor(AA+16,BB)

//初期化
void setup() {

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

}//setup


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

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

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

  //46を設定
  int tempval = 46;

  // 1行目に46を表示
  display.println(tempval);

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

  delay(1000); //1秒待つ

}//loop



1
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
1
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?