本帖最后由 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);
- }
復制代碼
有請大神們幫忙分析一下,問題出現在哪里,為什么編譯不過呢?謝謝。
|