Arduino Wemos D1和TFT LCD屏蔽
我用的是像WeMos D1这样的Arduino和TFT液晶屏。当我想运行graphictest之类的示例程序时,它不会编译该程序,并且会出现以下错误:Arduino Wemos D1和TFT LCD屏蔽,arduino,Arduino,我用的是像WeMos D1这样的Arduino和TFT液晶屏。当我想运行graphictest之类的示例程序时,它不会编译该程序,并且会出现以下错误: Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); A3' was not declared in this scope A2' was not declared in this scope A1' was not declared in this scope 以下是
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
A3' was not declared in this scope
A2' was not declared in this scope
A1' was not declared in this scope
以下是定义管脚的代码:
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
如果您查看WeMos D1板,您会发现没有
A1
、A2
或A3
引脚。ESP8266只有一个模拟引脚(
A0
),不能用作数字引脚
A3等的定义在中,因此您需要先包含
,或者直接输入数字,如3,2,1等。现在如何定义此Adafruit_TFTLCD tft(LCD_CS、LCD_CD、LCD_WR、LCD_RD、LCD_RESET);你不能用液晶屏作为屏蔽。您需要重新布线以使用其他管脚,然后在代码中使用这些管脚。