2017-02-19 84 views
2

我正在使用类似Arduino的WeMos D1和TFT LCD屏蔽。当我想运行像graphictest一个示例程序,它不会编译程序,它给了我这些错误:Wemos D1和TFT液晶显示器屏蔽

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 
+0

为'A3'等的定义是https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/variants/standard/pins_arduino.h,所以你首先需要'#include ',或者直接编号如3,2,1等 –

回答

2

如果你看一下WeMos D1板,您会看到没有A1,A2A3引脚。
ESP8266只有一个模拟引脚(A0),并且不能用作数字引脚。

enter image description here

+0

现在该如何定义这个Adafruit_TFTLCD tft(LCD_CS,LCD_CD,LCD_WR,LCD_RD,LCD_RESET); – mjvoodoo

+0

您不能将LCD用作屏蔽。您需要重新连线才能使用其他引脚,然后在代码中使用这些引脚。 –