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?

[I2C]STM32C0116-DKとOLED SSD1306で遊ぶ(NOKIA46と表示)(GROVE)

Last updated at Posted at 2025-08-07

いろいろ、注意

  • かころぐ見よ!!
  • Adafruit_SSD1306をインストール
  • Adafruit_GFXをインストール
  • [NOKIA46]は、とくに、意味なし
  • 20250807 スクールドラゴンでかっきーさんと、なぎさんは、ステージでライブやっているよ!!!(何の事。!!!

結果

  • なぜか約30キロバイト

Screenshot from 2025-08-07 11-24-16.png

image_original(54).jpg

プログラム




//ssd1306_NOKIA46_c0116_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アドレスは使用するディスプレイに合わせて変更する
  // SCREEN_ADDRESSは、アドレス
  // SSD1306_SWITCHCAPVCCは、チャージポンプをオンにする
  display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS);

}  //setup


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

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

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


  // NOKIA46を表示
  display.println("NOKIA46");


  // 描画バッファの内容を画面に表示
  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?