LoginSignup
0
0

More than 1 year has passed since last update.

秋月のカラーOLED 0.95インチで遊ぶ(STM32G071)P-14435

Posted at

x 過去ログをみよ
x Arduino UNOと配線は、同じ

目的
カラーOLEDのテスト

SSD1331その互換機の標準的なライブラリになっている
Adafruit SSD1331 + Adafruit GFXのインストール で
文字列を表示して遊ぶ

1.Adafruit SSD1331 OLED Driver Library for Arduino を インストール
2.Adafruit GFX Library を インストール

[QT095B]
通販コード P-14435
発売日 2019/09/02

sclk 13 , SCL
mosi 11 , SDA
cs 10 , CS
rst 9 , RES
dc 8 , DC

3.3V , 3.3V
GND , GND

o_cop378.jpg

Arduino UNOのプログラムと完全に同じ




//test_ssd1331_uno_0207

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1331.h>
#include <SPI.h>


// You can use any (4 or) 5 pins
#define sclk 13
#define mosi 11
#define cs   10
#define rst  9
#define dc   8


// Color definitions
#define BLACK           0x0000
#define BLUE            0x001F
#define RED             0xF800
#define GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0
#define WHITE           0xFFFF


Adafruit_SSD1331 display = Adafruit_SSD1331(&SPI, cs, dc, rst);

//初期化
void setup() {

  display.begin();

  //display.fillScreen(BLACK);

}//setup


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

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

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


  // 1行目に数字を表示
  display.println("UNO");

  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