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?

More than 1 year has passed since last update.

Arduino UNOと秋月ST7789V2(ATM0130B3(SPI))にアイテムを表示する(drawBitmap)K-15560

Last updated at Posted at 2023-07-30

Arduino UNOと秋月ST7789V2(ATM0130B3(SPI))にアイテムを表示する(drawBitmap)K-15560

x Adafruit ST7735 を インストール
x Adafruit GFX Library を インストール

目的
カラー液晶のテスト

o_cop633.jpg

接続

3.3V-3.3V(VDD(1))
5V-5V(VDDIO(2))
GND-GND(3)

13 sck- SCK(4)
12
11 mosi-MOSI(5)
10 cs-CS(6)
9 res-RES(8)
8 dc-D_C(7)

リセットとコマンドデータ切り替えが逆なので注意 何の事?

プログラム




//spi_st7789_BITMAP_TEST1_UNO_uno_1


//ヘッダーファイル
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>


//定義
#define TFT_CS        10
#define TFT_RST        9 // Or set to -1 and connect to Arduino RESET pin
#define TFT_DC         8
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);


// ビットマップデータ
uint8_t databytes[8] = 

{

0b01100110,
0b10101111,
0b10111111,
0b11011111,

0b01111110,
0b01111110,
0b00111100,
0b00011000

};


//初期化
void setup() {

  //240x240の液晶を使用する。
  tft.init(240, 240);           // Init ST7789 240x240

}//setup


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

  // 画面表示をクリア
  tft.fillScreen(ST77XX_BLACK);


  //ビットマップの表示
  tft.drawBitmap(0, 0, databytes, 8, 8,  ST77XX_RED);


  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?