本帖最后由 sujingliang 于 2025-3-7 20:26 编辑
连线图
在 "文件"->"示例"->"AmebaSPI"->"LCD_Screen_ILI9341_TFT"中打开示例。
#define TFT_RESET 5
#define TFT_DC 4
#define TFT_CS SPI_SS
#define TFT_LED 11
TFT背光使用11引脚
SPI用SPI0,对应引脚
SPI_MOSI 13
SPI_MISO 14
SPI_SCLK 15
SPI_SS 12
#define SPI_MOSI AMB_D13 // SPI_0_MOSI AMB_D13
#define SPI_MISO AMB_D14 // SPI_0_MISO AMB_D14
#define SPI_SCLK AMB_D15 // SPI_0_SCL AMB_D15
#define SPI_SS AMB_D12 // SPI_0_CS0 AMB_D12
/* Digital pin mapping refer to g_APinDescription */
#define AMB_D0 0 // PF_5
#define AMB_D1 1 // PF_6
#define AMB_D2 2 // PF_7
#define AMB_D3 3 // PF_8
#define AMB_D4 4 // PF_11
#define AMB_D5 5 // PF_12
#define AMB_D6 6 // PF_13
#define AMB_D7 7 // PF_14
#define AMB_D8 8 // PF_15
#define AMB_D9 9 // PF_2
#define AMB_D10 10 // PF_1
#define AMB_D11 11 // PF_0
#define AMB_D12 12 // PE_4
#define AMB_D13 13 // PE_3
#define AMB_D14 14 // PE_2
#define AMB_D15 15 // PE_1
#define AMB_D16 16 // PD_18
#define AMB_D17 17 // PD_17
#define AMB_D18 18 // PD_16
#define AMB_D19 19 // PD_15
#define AMB_D20 20 // PD_14
#define AMB_D21 21 // PA_2
#define AMB_D22 22 // PA_3
#define AMB_D23 23 // PF_9
#define AMB_D24 24 // PE_6
#define AMB_D25 25 // PF_4
#define AMB_D26 26 // PF_3
#define AMB_D27 27 // PA_1
#define AMB_D28 28 // PA_0
#define AMB_D29 29 // PF_10
void setup()中增加:
pinMode(TFT_LED,OUTPUT);
digitalWrite(TFT_LED,HIGH);
unsigned long testText()中增加
tft.setForeground(ILI9341_GREEN);
tft.setFontSize(4);
tft.println("Hello BW21-CBV-Kit");
|