概要
geeekpiのPico_Breadboard_Kitを入手しました。
Pico C/C++ SDKで作成されたデモプログラムの表示画面です。
詳細
Arduino IDE + Raspberry Pi Picoで画面を表示してみます。
ST9996Sのライブラリをインストールします。
サンプルプログラム ST7796S_demo を開きます。
サンプルプログラムを下記の通り修正します。
ST7796S_demo.ino
// Define display pin connections
- #define TFT_CS 10
- #define TFT_DC 8
- #define TFT_RST 9 // Or set to -1 and connect to Arduino RESET pin
+ #define TFT_CS 5
+ #define TFT_DC 6
+ #define TFT_RST 7 // Or set to -1 and connect to Arduino RESET pin
+ #define TFT_SCLK 2
+ #define TFT_MOSI 3
// Initialize the display
- Adafruit_ST7796S display(TFT_CS, TFT_DC, TFT_RST);
+ Adafruit_ST7796S display(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
show_canvas(); はコメントアウトしました。
#if !defined(__AVR__)
// we dont have the RAM or Flash for canvas
- show_canvas();
+ //show_canvas();
#endif
表示できました。
まとめ
Raspberry Pi Pico の GPIOピンと TFT スクリーンの接続は下表の通りです。
| Raspberry Pi Pico | SPI信号名 | TFT スクリーン | 説明 |
|---|---|---|---|
| GP2 | SCLK | CLK | クロック |
| GP3 | MOSI | DIN | メイン出力/サブ入力 |
| GP4 | MISO | メイン入力/サブ出力 | |
| GP5 | CS | CS | チップ セレクト |
| GP6 | DC | データ/コマンド | |
| GP7 | RST | RST | リセット |




