【发布时间】:2017-02-21 00:41:44
【问题描述】:
我正在使用类似 Arduino 的 WeMos D1 和 TFT LCD 屏。当我想运行一个像 graphicstest 这样的示例程序时,它不会编译该程序并给我这些错误:
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
【问题讨论】:
-
A3等的定义在github.com/arduino/Arduino/blob/master/hardware/arduino/avr/…,所以你需要先#include <pins_arduino.h>,或者直接做pinnumber,比如3,2,1等。
标签: arduino