本帖最后由 mengsiu 于 2022-10-5 23:07 编辑
最近买了一个TFT显示屏,在网上找了该屏的驱动例程。有51的,有Arduino的,也有STM32的。
已经使用51的代码测试过,成功点亮。唯一不足的是51的速度太慢,导致刷屏速度也慢。
我现在想试试Arduino的代码如何。但我手头上并没有正式的Arduino板,只有8266的板,加上我也是刚接触的Arduino,操作并不熟练。
当前情况是:
- 我的8266板是好的;
- 电脑也安装好Arduino,加载了8266库;
- 曾试过能成功编译程序,并运行;
- 根据网上的说法,加载程序后选择
开发板,就可以使用ESP8266了。 - 我找到的例程在Arduino里选择
开发板时能正常编译,但我手头上并没有正式的Arduino板,所以并不能验证是否能运行; - 而选择
开发板,编译时会报错,如下
- c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\clear_Screen.ino.cpp.o: in function `loop':
- C:\Users\Administrator\Desktop\Demo_UNO_Software_SPI\Example_01_clear_screen\clear_Screen/clear_Screen.ino:56: undefined reference to `_ZN11LCDWIKI_SPIC1Etaaaaaaa'
- c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\clear_Screen.ino.cpp.o: in function `__static_initialization_and_destruction_0':
- C:\Users\Administrator\Desktop\Demo_UNO_Software_SPI\Example_01_clear_screen\clear_Screen/clear_Screen.ino:59: undefined reference to `_ZN11LCDWIKI_SPIC1Etaaaaaaa'
- collect2.exe: error: ld returned 1 exit status
- exit status 1
- 为开发板 Generic ESP8266 Module 编译时出错。
复制代码
- 例程如下:
- #include <LCDWIKI_GUI.h> //Core graphics library
- #include <LCDWIKI_SPI.h> //Hardware-specific library
- //paramters define
- #define MODEL ST7735S128
- #define CS 2
- #define CD 4
- #define RST 5
- #define SDA 12
- #define SCK 13
- #define LED 0 //if you don't need to control the LED pin,you should set it to -1 and set it to 3.3V
- //the definiens of software spi mode as follow:
- //if the IC model is known or the modules is unreadable,you can use this constructed function
- LCDWIKI_SPI mylcd(MODEL,CS,CD,-1,SDA,RST,SCK,LED); //model,cs,dc,sdo,sda,reset,sck,led
- void setup()
- {
- mylcd.Init_LCD();
- mylcd.Fill_Screen(0x0000);
- mylcd.Fill_Screen(0xFFFF);
- }
- void loop()
- {
- mylcd.Fill_Screen(0,0,0);
- mylcd.Fill_Screen(255,255,255);
- mylcd.Fill_Screen(255,0,0);
- mylcd.Fill_Screen(0,255,0);
- mylcd.Fill_Screen(0,0,255);
- delay(3000);
- mylcd.Fill_Screen(0,0,0);
- delay(1000);
- mylcd.Fill_Screen(255,255,255);
- delay(1000);
- mylcd.Fill_Screen(0xF800);
- delay(1000);
- mylcd.Fill_Screen(0x07E0);
- delay(1000);
- mylcd.Fill_Screen(0x001F);
- delay(3000);
- }
复制代码
有请大神们帮忙分析一下,问题出现在哪里,为什么编译不过呢?谢谢。
|