Arduino筆記(65):Adafruit_GFX圖形程式庫用於顯示器(下)

本篇實作接續上一篇將圖形顯示在TFT LCD屏幕上,差別在於上一篇是引用別人已經產生的16進位程式碼,本篇要來實作,如何從選取的圖檔,轉換成16進位程式碼,讓 Arduino的程式讀取後,顯示在LCD螢幕。
首先,找一個要轉檔的圖片,找的圖形要線條稍微簡單,程式中轉成單色的圖片會比較好看。我找了一隻魚的Clipart 圖片當作範例:


下載的檔案,圖片的解析度是6805x4431,先用小畫家,將圖片縮小,縮小的比例,依照顯示器的大小來決定。以我的顯示器為例,ST7735解析度160x128,先選擇「調整大小」→「像素」→ 輸入解析度(不要超過顯示器的數值)→ 「確定」,看到畫面縮小後存檔。

到 這裡 下載 LCD Image Converter 轉檔工具。下載後執行程式,並開啟小畫家儲存的檔案。

下拉選單「Options」→ 「Conversion」,開啟另一個視窗,在「Preset:」下拉選擇「Monochrome」,反白「Inverse」欄位打勾。


點選頁簽「Image」→ 在Block size:選擇「16 bit」。

按下「Show Preview」,出現以下視窗:

將右邊一堆16進位的數字「全選Ctrl+A」複製Ctrl+C起來。開啟 Arduino IDE 程式,貼在以下兩行程式中間。
static const unsigned char PROGMEM fish[] = {

};
再使用 drawBitmap()函式將上面的16進位資料載入,就會呈現單一的顏色圖形在顯示器上。

到這裡已經將顯示器常用的繪圖、文字、圖形的功能做一些紀錄與實作,接下來要接上SD卡,SD卡上有圖檔,看看如何將圖檔顯示在屏幕上。

[程式]

#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>

#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8
#define TFT_SCLK 13   
#define TFT_MOSI 11   

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

static const unsigned char PROGMEM fish[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x005c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x00ff, 0x0068, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00bf, 0x0000, 0x00b0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x00d0, 0x00b5, 0x0040, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00f4, 0x000a, 0x0049, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0007, 0x0049, 0x0051, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001a, 0x0024, 0x008a, 0x00da, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0071, 0x0049, 0x0076, 0x004c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x00ca, 0x0025, 0x0049, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0024, 0x009a, 0x0092, 0x0098, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x0092, 0x0069, 0x0024, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0014, 0x00a5, 0x0092, 0x0049, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0012, 0x0012, 0x0049, 0x002a, 0x00e0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0035, 0x0049, 0x0026, 0x00d5, 0x0040, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0060, 0x00a4, 0x0091, 0x0024, 0x00c0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0057, 0x005b, 0x0054, 0x0092, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000b, 0x00dd, 0x006d, 0x00ff, 0x0068, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00fc, 0x0042, 0x0010, 0x0001, 0x005f, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x0042, 0x00a9, 0x004a, 0x00aa, 0x0042, 0x00e0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0034, 0x0092, 0x0014, 0x00a4, 0x0091, 0x0028, 0x003c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0001, 0x00d2, 0x0049, 0x0042, 0x0012, 0x004a, 0x0095, 0x0087, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0006, 0x0089, 0x0024, 0x00a9, 0x0049, 0x0024, 0x0042, 0x0051, 0x00c0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x001a, 0x0054, 0x0092, 0x004a, 0x00a4, 0x0092, 0x00a9, 0x0028, 0x0070, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0069, 0x0022, 0x0049, 0x0024, 0x002a, 0x0049, 0x0014, 0x0085, 0x001c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x002f, 0x00fe, 
0x0000, 0x0000, 0x0001, 0x00a4, 0x0095, 0x00a5, 0x0052, 0x0091, 0x0024, 0x00a2, 0x0054, 0x0087, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0003, 0x00d0, 0x0003, 
0x0000, 0x0000, 0x0002, 0x0092, 0x0048, 0x0072, 0x0009, 0x004a, 0x0092, 0x0049, 0x0022, 0x0051, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x003c, 0x002a, 0x00b5, 
0x0000, 0x0000, 0x000e, 0x0049, 0x0025, 0x0019, 0x0054, 0x0024, 0x0055, 0x0024, 0x0095, 0x002a, 0x0060, 0x0000, 0x0000, 0x0000, 0x0001, 0x00c2, 0x0089, 0x0045, 
0x0000, 0x0000, 0x0011, 0x0024, 0x0092, 0x00a6, 0x0042, 0x0092, 0x0088, 0x0092, 0x0048, 0x0091, 0x0030, 0x0000, 0x0000, 0x0000, 0x0006, 0x0029, 0x0052, 0x002a, 
0x0000, 0x0000, 0x0034, 0x0092, 0x0048, 0x004b, 0x0029, 0x0049, 0x0025, 0x0049, 0x0052, 0x004a, 0x009c, 0x0000, 0x0000, 0x0000, 0x0039, 0x004a, 0x0024, 0x0093, 
0x0000, 0x0000, 0x0065, 0x0049, 0x0025, 0x0021, 0x004a, 0x0024, 0x00a8, 0x0025, 0x0009, 0x0050, 0x0046, 0x0000, 0x0000, 0x0000, 0x00c4, 0x0091, 0x004a, 0x0049, 
0x0000, 0x0000, 0x00c8, 0x0024, 0x00a9, 0x004a, 0x00a4, 0x00aa, 0x0012, 0x0094, 0x00a5, 0x000a, 0x00a9, 0x0000, 0x0000, 0x0003, 0x002a, 0x004a, 0x0021, 0x0026, 
0x0000, 0x0001, 0x0092, 0x0092, 0x0084, 0x0094, 0x00d2, 0x0041, 0x004a, 0x0052, 0x0052, 0x0052, 0x0012, 0x0080, 0x0000, 0x000c, 0x0091, 0x0024, 0x0095, 0x0052, 
0x0000, 0x0003, 0x0025, 0x004a, 0x0052, 0x0049, 0x0025, 0x002c, 0x00a1, 0x0049, 0x0014, 0x00a9, 0x0049, 0x0040, 0x0000, 0x0032, 0x004a, 0x0092, 0x00a8, 0x008a, 
0x0000, 0x0006, 0x0048, 0x0051, 0x0029, 0x0024, 0x00a8, 0x0092, 0x0055, 0x0024, 0x00a2, 0x0044, 0x00a4, 0x00e0, 0x0000, 0x0049, 0x0024, 0x0048, 0x004a, 0x0056, 
0x0000, 0x0009, 0x0025, 0x002e, 0x0044, 0x0092, 0x0032, 0x0049, 0x0008, 0x0092, 0x0049, 0x002a, 0x0012, 0x0030, 0x0001, 0x00a5, 0x0052, 0x00a7, 0x00b2, 0x0084, 
0x0000, 0x000c, 0x0092, 0x00d1, 0x00aa, 0x0049, 0x0055, 0x0024, 0x00a5, 0x0049, 0x0024, 0x0081, 0x0055, 0x0058, 0x0006, 0x0052, 0x0009, 0x0058, 0x0048, 0x0054, 
0x0000, 0x0012, 0x0049, 0x0000, 0x0045, 0x0024, 0x0090, 0x0092, 0x0052, 0x0024, 0x0095, 0x005a, 0x0088, 0x0088, 0x0009, 0x0029, 0x0056, 0x00a5, 0x0025, 0x002c, 
0x0000, 0x0035, 0x0026, 0x002c, 0x0030, 0x0092, 0x005a, 0x0049, 0x0014, 0x0092, 0x0048, 0x0022, 0x0052, 0x004c, 0x0035, 0x0044, 0x00b4, 0x004a, 0x0092, 0x0088, 
0x0000, 0x0062, 0x0052, 0x0077, 0x0095, 0x004a, 0x0089, 0x0054, 0x00a2, 0x0049, 0x0025, 0x0094, 0x0089, 0x0024, 0x0052, 0x002b, 0x0049, 0x0020, 0x00a8, 0x00b8, 
0x0000, 0x0049, 0x000c, 0x00ba, 0x0089, 0x0028, 0x005a, 0x0022, 0x0095, 0x0025, 0x0052, 0x0049, 0x0024, 0x0097, 0x00c9, 0x0054, 0x00a4, 0x0096, 0x0005, 0x0010, 
0x0000, 0x00d4, 0x00a8, 0x008f, 0x00ca, 0x0045, 0x0029, 0x0049, 0x0020, 0x0094, 0x0024, 0x0092, 0x0052, 0x004a, 0x0024, 0x00d2, 0x0012, 0x0049, 0x0068, 0x00b0, 
0x0001, 0x0082, 0x0049, 0x000a, 0x0089, 0x0029, 0x004a, 0x0024, 0x0096, 0x0052, 0x0092, 0x0049, 0x0029, 0x0022, 0x0097, 0x0009, 0x0049, 0x0024, 0x008a, 0x0060, 
0x0003, 0x002a, 0x00a9, 0x000b, 0x0064, 0x0092, 0x0029, 0x0052, 0x0049, 0x0024, 0x00a9, 0x0024, 0x0085, 0x0055, 0x0048, 0x00a4, 0x00a4, 0x00a9, 0x0025, 0x0040, 
0x000c, 0x0091, 0x0009, 0x008d, 0x00ca, 0x0049, 0x004c, 0x0089, 0x0024, 0x0092, 0x0044, 0x0092, 0x0052, 0x0012, 0x00a4, 0x0052, 0x0052, 0x0084, 0x0090, 0x00c0, 
0x0015, 0x004a, 0x0054, 0x00f7, 0x0049, 0x0024, 0x0092, 0x0054, 0x0092, 0x0049, 0x002a, 0x0049, 0x0029, 0x004a, 0x0012, 0x0089, 0x0009, 0x002a, 0x004a, 0x0080, 
0x0032, 0x0024, 0x00a4, 0x00ad, 0x00ca, 0x0092, 0x004d, 0x0022, 0x0049, 0x0024, 0x0081, 0x0024, 0x0094, 0x00a3, 0x004b, 0x007f, 0x00f6, 0x00f5, 0x0029, 0x0080, 
0x0049, 0x0052, 0x0014, 0x00f6, 0x0088, 0x0049, 0x0028, 0x0095, 0x0024, 0x0092, 0x005a, 0x0092, 0x00a2, 0x0015, 0x0024, 0x0080, 0x0009, 0x000a, 0x0093, 0x0000, 
0x0054, 0x0089, 0x004a, 0x002f, 0x0015, 0x0024, 0x0095, 0x0048, 0x00aa, 0x0049, 0x0022, 0x004a, 0x0015, 0x0052, 0x0092, 0x0055, 0x0054, 0x00a1, 0x004e, 0x0000, 
0x00c2, 0x0054, 0x00a2, 0x0010, 0x0022, 0x0095, 0x004a, 0x0025, 0x0011, 0x0054, 0x0094, 0x00a4, 0x00c8, 0x008c, 0x0049, 0x0022, 0x0022, 0x004c, 0x0024, 0x0000, 
0x00a9, 0x0022, 0x0055, 0x0080, 0x00d4, 0x0051, 0x0029, 0x0052, 0x004a, 0x0022, 0x00a2, 0x0012, 0x0025, 0x0025, 0x0054, 0x0094, 0x0095, 0x0022, 0x0098, 0x0000, 
0x0094, 0x0095, 0x0008, 0x0077, 0x0009, 0x0024, 0x009a, 0x0009, 0x0051, 0x004a, 0x0015, 0x0055, 0x0050, 0x00ba, 0x002a, 0x0049, 0x0048, 0x0094, 0x00b0, 0x0000, 
0x004a, 0x0048, 0x00a5, 0x0008, 0x00a4, 0x0092, 0x0049, 0x0054, 0x0025, 0x0024, 0x00a0, 0x0088, 0x008a, 0x00d5, 0x0049, 0x0024, 0x00a5, 0x0022, 0x0060, 0x0000, 
0x0071, 0x0052, 0x0052, 0x00a5, 0x0012, 0x0049, 0x0034, 0x00a2, 0x0092, 0x0052, 0x0096, 0x0052, 0x0053, 0x0048, 0x0096, 0x0092, 0x0010, 0x0095, 0x0040, 0x0000, 
0x001f, 0x00a5, 0x0008, 0x0052, 0x0055, 0x0024, 0x0092, 0x0014, 0x00a9, 0x0008, 0x0049, 0x0025, 0x000e, 0x000a, 0x00a2, 0x0049, 0x004a, 0x0049, 0x0080, 0x0000, 
0x0020, 0x0048, 0x00aa, 0x0089, 0x0020, 0x0095, 0x0054, 0x00a2, 0x0044, 0x00a5, 0x0024, 0x0090, 0x00b8, 0x000a, 0x0095, 0x00a4, 0x00a5, 0x0025, 0x0000, 0x0000, 
0x0035, 0x0025, 0x0044, 0x00a4, 0x0096, 0x0051, 0x002b, 0x0049, 0x002a, 0x005a, 0x0092, 0x004a, 0x0060, 0x0009, 0x0048, 0x0092, 0x0052, 0x0096, 0x0000, 0x0000, 
0x0024, 0x0092, 0x002a, 0x002a, 0x0049, 0x0024, 0x00a2, 0x002a, 0x0089, 0x002d, 0x0049, 0x0025, 0x00c0, 0x000c, 0x00a5, 0x006a, 0x0088, 0x004a, 0x0000, 0x0000, 
0x0032, 0x0049, 0x0041, 0x0041, 0x0024, 0x0092, 0x0055, 0x0044, 0x0056, 0x0092, 0x0024, 0x0092, 0x0080, 0x000a, 0x0052, 0x0011, 0x0025, 0x0038, 0x0000, 0x0000, 
0x0029, 0x0024, 0x009a, 0x002c, 0x0092, 0x0049, 0x0053, 0x0029, 0x0021, 0x006d, 0x00aa, 0x0056, 0x0000, 0x0009, 0x0029, 0x005c, 0x0092, 0x0090, 0x0000, 0x0000, 
0x001c, 0x0092, 0x0045, 0x0042, 0x0049, 0x0024, 0x00c9, 0x0092, 0x0095, 0x0022, 0x0091, 0x004c, 0x0000, 0x0004, 0x00a4, 0x0086, 0x0049, 0x0050, 0x0000, 0x0000, 
0x0007, 0x0049, 0x0028, 0x00a9, 0x0054, 0x0095, 0x0092, 0x00a5, 0x00a4, 0x0095, 0x00a4, 0x00b0, 0x0000, 0x000d, 0x0032, 0x0051, 0x0024, 0x0010, 0x0000, 0x0000, 
0x0000, 0x00e4, 0x0092, 0x0014, 0x0082, 0x0049, 0x0024, 0x00c8, 0x0052, 0x0048, 0x0092, 0x0050, 0x0000, 0x0004, 0x0095, 0x002a, 0x00d2, 0x00b0, 0x0000, 0x0000, 
0x0000, 0x003a, 0x0049, 0x0045, 0x002a, 0x00a5, 0x0049, 0x0035, 0x005a, 0x00a5, 0x0049, 0x00c0, 0x0000, 0x0005, 0x0048, 0x0084, 0x00a9, 0x0058, 0x0000, 0x0000, 
0x0000, 0x000d, 0x0025, 0x0028, 0x00a8, 0x0052, 0x0094, 0x0099, 0x0025, 0x0012, 0x00a5, 0x0000, 0x0000, 0x0004, 0x002d, 0x0052, 0x0054, 0x0090, 0x0000, 0x0000, 
0x0000, 0x0003, 0x0052, 0x0052, 0x0045, 0x000d, 0x0022, 0x004e, 0x0092, 0x00e8, 0x00d3, 0x0000, 0x0000, 0x0006, 0x0094, 0x0029, 0x0016, 0x0050, 0x0000, 0x0000, 
0x0000, 0x0001, 0x0089, 0x0025, 0x0029, 0x0054, 0x0095, 0x0021, 0x00c8, 0x0017, 0x008e, 0x0000, 0x0000, 0x0002, 0x0045, 0x0044, 0x00a3, 0x0018, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0064, 0x0092, 0x0092, 0x0059, 0x0048, 0x0094, 0x007f, 0x0048, 0x00a8, 0x0000, 0x0000, 0x0002, 0x00aa, 0x0092, 0x0054, 0x00d0, 0x0000, 0x0000, 
0x0000, 0x0000, 0x003a, 0x0048, 0x0049, 0x0012, 0x0025, 0x004a, 0x0082, 0x00f6, 0x00b0, 0x0000, 0x0000, 0x0003, 0x0012, 0x0055, 0x0009, 0x0018, 0x0000, 0x0000, 
0x0000, 0x0000, 0x000c, 0x00a5, 0x0024, 0x00a4, 0x0092, 0x0021, 0x0029, 0x0015, 0x0060, 0x0000, 0x0000, 0x0001, 0x0049, 0x0088, 0x00a4, 0x00a8, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0007, 0x0012, 0x0092, 0x0052, 0x0049, 0x0054, 0x0094, 0x00a5, 0x0080, 0x0000, 0x0000, 0x0001, 0x0024, 0x00a5, 0x0052, 0x0050, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0001, 0x00c8, 0x0049, 0x0009, 0x0024, 0x000a, 0x0042, 0x004a, 0x0080, 0x0000, 0x0000, 0x0001, 0x0092, 0x0092, 0x0009, 0x0018, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0075, 0x0054, 0x00a4, 0x00aa, 0x00d1, 0x0029, 0x002e, 0x0000, 0x0000, 0x0000, 0x0000, 0x00a9, 0x0054, 0x00a4, 0x00a8, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x001d, 0x0002, 0x0092, 0x0081, 0x0024, 0x0094, 0x0090, 0x0000, 0x0000, 0x0000, 0x0000, 0x0084, 0x00a2, 0x0052, 0x0050, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0003, 0x00ea, 0x0054, 0x005a, 0x004a, 0x0042, 0x00f0, 0x0000, 0x0000, 0x0000, 0x0000, 0x00d5, 0x0029, 0x0029, 0x0018, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0074, 0x008a, 0x0084, 0x0091, 0x002b, 0x0040, 0x0000, 0x0000, 0x0000, 0x0000, 0x0050, 0x00b4, 0x0085, 0x0050, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x0051, 0x0032, 0x004a, 0x00ae, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x004a, 0x004a, 0x0054, 0x0098, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00fc, 0x0089, 0x0025, 0x0070, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0029, 0x0029, 0x0022, 0x0050, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0007, 0x00f6, 0x00df, 0x0040, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0034, 0x008c, 0x0095, 0x0018, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0015, 0x0050, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0012, 0x0055, 0x0048, 0x00a8, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0019, 0x0042, 0x0025, 0x0010, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x002b, 0x0052, 0x0050, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0009, 0x0049, 0x0009, 0x0050, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0024, 0x00d4, 0x0030, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0005, 0x0052, 0x00a2, 0x0090, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0089, 0x0049, 0x0050, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0003, 0x0024, 0x002a, 0x0030, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0052, 0x00b1, 0x0050, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x008a, 0x0054, 0x00a0, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00d1, 0x000a, 0x0030, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x004a, 0x00ad, 0x0060, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0068, 0x0090, 0x00a0, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, 0x0025, 0x0020, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0018, 0x0092, 0x0060, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0015, 0x0049, 0x0040, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x0024, 0x00c0, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0005, 0x0052, 0x0080, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0009, 0x0080, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x00aa, 0x0080, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0045, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00ab, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00c6, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0038, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0028, 0x0000, 0x0000, 0x0000, 
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000, 0x0000
};

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

void setup() 
{ 
  tft.initR(INITR_BLACKTAB); // 初始化設定 ST7735S chip, black tab
  tft.setRotation(3);   //轉 270度
  tft.fillScreen(BLACK);
  tft.drawBitmap(1,10,fish,160,104,ORANGE);
} 

void loop() 
{ 
}

[執行結果]


[參考資料]

Post a Comment

較新的 較舊