接線圖
接線圖
CS —————D8 GPIO15 有的屏可以不接
BLK—————3V3 低電平觸發(fā)的屏幕可以不接
WEMOS D1 MINI針腳
按照esp8266的傳統(tǒng)接法 修改配置文件
image.png
選擇芯片
image.png
分辨率
image.png
取消接口注釋
image.png
上傳示例程序
image.png
上傳自制圖片
1.轉(zhuǎn)換圖片為565格式
565轉(zhuǎn)換
把導(dǎo)出的 .c 圖片擴(kuò)展名修改為 .h
修改該文件:下圖第一行貌似可以刪除。第二行前面藍(lán)色部分替換成下圖樣子。
image.png
2.代碼:
#include <SPI.h>
#include <TFT_eSPI.h>
#include "As.h"
#include "yoyo240.h"
//#include "yoyo240.h"
//#include "qq240x309.h"
TFT_eSPI tft = TFT_eSPI();
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
tft.begin();
tft.init();
tft.fillScreen(TFT_BLACK);
tft.setCursor(60,200,1);
tft.setTextColor(TFT_YELLOW);
tft.setTextSize(2);
tft.println("TFT_Text");
tft.fillCircle(100,100,10,TFT_BLUE);
//tft.drawLine(10,50,118,50,TFT_WHITE);
tft.drawPixel(186,279,TFT_RED);
tft.setTextColor(TFT_WHITE,TFT_BLUE);
tft.setCursor(80,80,1);
tft.println("TFT_Text");
tft.setRotation(1);
tft.setSwapBytes(true);
//tft.pushImage(52,40, 260, 146, zx1); // 在(4,4)處顯示Name圖片 128×128像素
delay(3000);
tft.pushImage(0,0, 240, 240, yoyo240);
}
void loop() {
/*
tft.fillScreen(TFT_BLACK);
tft.pushImage(0,0, 240, 309,qq240x309);
delay(2000);
tft.fillScreen(TFT_BLACK);
tft.setCursor(100,150,1);
tft.setTextColor(TFT_YELLOW);
tft.setTextSize(4);
tft.println("LOVE MM");
delay(1000);
// tft.fillScreen(TFT_BLACK);
tft.pushImage(0,20, 320, 200, zx320x200);
delay(2000);
tft.fillScreen(TFT_BLACK);
tft.pushImage(20,40, 235, 143, yoyo);
delay(2000);
tft.setCursor(60,150,1);
tft.setTextColor(TFT_YELLOW);
tft.setTextSize(2);
tft.println("LOVE MM");
delay(1000);
tft.pushImage(220,130, 64, 64, Astronaut[i]);
i+=1;
if(i>8)
i=0;
delay(1000);
*/
}
image.png
image.png
image.png
image.png