0.1.3 合宙CORE-ESP32-C3开发板用arduino点亮ST7735 1.8寸TFT屏【已更新失效链接2022.07.10】
9.9的ESP32开发板想用arduino开发,无奈都是用luatos玩,于是折腾了下
目的
用arduino驱动合宙ESP32-C3开发板点亮S7735TFT屏
材料
CORE-ESP32-C3开发板*1
ST77351.8寸TFT屏128*160分辨率*1
连接
实施
1、配置ESP32环境【详见本专题0.0.0博文0.0.0 arduino安装及开发板配置_̌萌新历险记的博客-CSDN博客】
在不丢失ESP8266的情况下,打开arduino-文件-首选项,附加开发板管理器网址
在原ESP8266的网址后面加逗号“,”
https://arduino.esp8266.com/stable/package_esp8266com_index.json,https://www.arduino.cn/package_esp32_index.json
保存,然后发现下载不了环境,直接下载离线包
下载地址1 阿里云盘: 阿里云盘分享https://www.aliyundrive.com/s/K5CLnqMjnj5
下载地址2 社区成员 鱼小黑 提供:Cloudrevehttps://cloud.codess-nas.top:5213/s/2Ocn
在此我要特别感谢 arduino中文社区提供的小白资源,我这个萌新差点就卡死在该死的GITHUB了,附上源链接,CSDN要是封了我就直接注销这平台了Arduino IDE安装esp32 SDK(Windows)2022.7.6更新-Arduino中文社区 - Powered by Discuz!
下载完不用打开arduino,直接安装,安装完成后打开就看到开发板列表了,安装自动匹配路径
波特率921600,flashmode选 DIO2接下来下载tft_espi,在库路径编辑......\Arduino\libraries\TFT_eSPI-2.4.61的user_setup.h文件
注意IO口是按开发板丝印的GPIO口来的并不是按ESP32pin脚来的
// Only define one driver, the other ones must be commented out
//#define ILI9341_DRIVER // Generic driver for common displays
//#define ILI9341_2_DRIVER // Alternative ILI9341 driver, see https://github.com/Bodmer/TFT_eSPI/issues/1172
#define ST7735_DRIVER // Define additional parameters below for this display
//#define ILI9163_DRIVER // Define additional parameters below for this display
//#define S6D02A1_DRIVER
//#define RPI_ILI9486_DRIVER // 20MHz maximum SPI
//#define HX8357D_DRIVER
//#define ILI9481_DRIVER
//#define ILI9486_DRIVER
//#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)
//#define ST7789_DRIVER // Full configuration option, define additional parameters below for this display
//#define ST7789_2_DRIVER // Minimal configuration option, define additional parameters below for this display
//#define R61581_DRIVER
//#define RM68140_DRIVER
//#define ST7796_DRIVER
//#define SSD1351_DRIVER
//#define SSD1963_480_DRIVER
//#define SSD1963_800_DRIVER
//#define SSD1963_800ALT_DRIVER
//#define ILI9225_DRIVER
//#define GC9A01_DRIVER// Some displays support SPI reads via the MISO pin, other displays have a single
// bi-directional SDA pin and the library will try to read this via the MOSI line.
// To use the SDA line for reading data from the TFT uncomment the following line:// #define TFT_SDA_READ // This option is for ESP32 ONLY, tested with ST7789 and GC9A01 display only// For ST7735, ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display
// Try ONE option at a time to find the correct colour order for your display// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
// #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red// For M5Stack ESP32 module with integrated ILI9341 display ONLY, remove // in line below// #define M5STACK// For ST7789, ST7735, ILI9163 and GC9A01 ONLY, define the pixel width and height in portrait orientation#define TFT_WIDTH 128
//#define TFT_WIDTH 128
// #define TFT_WIDTH 172 // ST7789 172 x 320
// #define TFT_WIDTH 240 // ST7789 240 x 240 and 240 x 320
#define TFT_HEIGHT 160
// #define TFT_HEIGHT 128
// #define TFT_HEIGHT 240 // ST7789 240 x 240
// #define TFT_HEIGHT 320 // ST7789 240 x 320
// #define TFT_HEIGHT 240 // GC9A01 240 x 240// For ST7735 ONLY, define the type of display, originally this was based on the
// colour of the tab on the screen protector film but this is not always true, so try
// out the different options below if the screen does not display graphics correctly,
// e.g. colours wrong, mirror images, or stray pixels at the edges.
// Comment out ALL BUT ONE of these options for a ST7735 display driver, save this
// this User_Setup file, then rebuild and upload the sketch to the board again:// #define ST7735_INITB
// #define ST7735_GREENTAB
// #define ST7735_GREENTAB2
// #define ST7735_GREENTAB3
// #define ST7735_GREENTAB128 // For 128 x 128 display
// #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
// #define ST7735_REDTAB
// #define ST7735_BLACKTAB
// #define ST7735_REDTAB160x80 // For 160 x 80 display with 24 pixel offset// If colours are inverted (white shows as black) then uncomment one of the next
// 2 lines try both options, one of the options should correct the inversion.// #define TFT_INVERSION_ON
// #define TFT_INVERSION_OFF// ##################################################################################
//
// Section 2. Define the pins that are used to interface with the display here
//
// ##################################################################################// If a backlight control signal is available then define the TFT_BL pin in Section 2
// below. The backlight will be turned ON when tft.begin() is called, but the library
// needs to know if the LEDs are ON with the pin HIGH or LOW. If the LEDs are to be
// driven with a PWM signal or turned OFF/ON then this must be handled by the user
// sketch. e.g. with digitalWrite(TFT_BL, LOW);// #define TFT_BL 32 // LED back-light control pin
// #define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)// We must use hardware SPI, a minimum of 3 GPIO pins is needed.
// Typical setup for ESP8266 NodeMCU ESP-12 is :
//
// Display SDO/MISO to NodeMCU pin D6 (or leave disconnected if not reading TFT)
// Display LED to NodeMCU pin VIN (or 5V, see below)
// Display SCK to NodeMCU pin D5
// Display SDI/MOSI to NodeMCU pin D7
// Display DC (RS/AO)to NodeMCU pin D3
// Display RESET to NodeMCU pin D4 (or RST, see below)
// Display CS to NodeMCU pin D8 (or GND, see below)
// Display GND to NodeMCU pin GND (0V)
// Display VCC to NodeMCU 5V or 3.3V
//
// The TFT RESET pin can be connected to the NodeMCU RST pin or 3.3V to free up a control pin
//
// The DC (Data Command) pin may be labelled AO or RS (Register Select)
//
// With some displays such as the ILI9341 the TFT CS pin can be connected to GND if no more
// SPI devices (e.g. an SD Card) are connected, in this case comment out the #define TFT_CS
// line below so it is NOT defined. Other displays such at the ST7735 require the TFT CS pin
// to be toggled during setup, so in these cases the TFT_CS line must be defined and connected.
//
// The NodeMCU D0 pin can be used for RST
//
//
// Note: only some versions of the NodeMCU provide the USB 5V on the VIN pin
// If 5V is not available at a pin you can use 3.3V but backlight brightness
// will be lower.// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP8266 SETUP ######// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
//#define TFT_CS PIN_D8 // Chip select control pin D8
//#define TFT_DC PIN_D3 // Data Command control pin
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V//#define TFT_BL PIN_D1 // LED back-light (only for ST7789 with backlight control pin)//#define TOUCH_CS PIN_D2 // Chip select pin (T_CS) of touch screen//#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only// ###### FOR ESP8266 OVERLAP MODE EDIT THE PIN NUMBERS IN THE FOLLOWING LINES ######// Overlap mode shares the ESP8266 FLASH SPI bus with the TFT so has a performance impact
// but saves pins for other functions. It is best not to connect MISO as some displays
// do not tristate that line when chip select is high!
// Note: Only one SPI device can share the FLASH SPI lines, so a SPI touch controller
// cannot be connected as well to the same SPI signals.
// On NodeMCU 1.0 SD0=MISO, SD1=MOSI, CLK=SCLK to connect to TFT in overlap mode
// On NodeMCU V3 S0 =MISO, S1 =MOSI, S2 =SCLK
// In ESP8266 overlap mode the following must be defined//#define TFT_SPI_OVERLAP// In ESP8266 overlap mode the TFT chip select MUST connect to pin D3
//#define TFT_CS PIN_D3
//#define TFT_DC PIN_D5 // Data Command control pin
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP32 SETUP ######// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_CS 15 // Chip select control pin
//#define TFT_DC 2 // Data Command control pin
//#define TFT_RST 4 // Reset pin (could connect to RST pin)
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST// For ESP32 Dev board (only tested with GC9A01 display)
// The hardware SPI can be mapped to any pins#define TFT_MOSI 03 // In some display driver board, it might be written as "SDA" and so on.
#define TFT_SCLK 02
#define TFT_CS 07 // Chip select control pin
#define TFT_DC 06 // Data Command control pin
#define TFT_RST 10 // Reset pin (could connect to Arduino RESET pin)
#define TFT_BL 11 // LED back-light//#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen//#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only
根据自己的TFT屏分辨率,是否带触摸进行配置,以上代码是按1.8寸128*160分辨率TFT ST7735屏更改的,对应开发板排线不用交叉调的GPIO口,
3打开示例,开发板选ESP32-C3 DEV MODULE ,编译刷入,不出意外直接点亮
----------------------------------------------------
附合宙开发板官方的pcb源链接,挺特别的一个datesheet
Interactive BOM for KiCADhttps://wiki.luatos.com/_static/bom/esp32c3.html
最后再次特别感谢 arduino中文社区提供的离线包
附上最简单的测试代码
#include <TFT_eSPI.h>
#include <SPI.h>TFT_eSPI tft = TFT_eSPI();
void setup()
{
Serial.begin(115200);
tft.begin();
tft.setRotation(0);
tft.fillScreen(TFT_RED);
}void loop()
{
tft.fillScreen(TFT_GREEN);
delay(100);
tft.fillScreen(TFT_BLUE);
delay(100);
tft.fillScreen(TFT_RED);
delay(100);
}
0.1.3 合宙CORE-ESP32-C3开发板用arduino点亮ST7735 1.8寸TFT屏【已更新失效链接2022.07.10】相关推荐
- 上海合宙Luat 模块 Air724开发板 入门指南(1)
Air724 是上海合宙物联网于2020年3月下旬发布的一款基于UIS8910DM芯片组的物联网通讯模块. 模块通讯性能优越,符合Cat1通讯标准,支持最大下行速率 10Mbps 和最大上行速率5Mb ...
- 0.1.3-01 合宙CORE-ESP32-C3制作1.3寸ST7789驱动的简单相册
本文基于aduino IDE以最简化的代码实现合宙ESP32-C3将图片传至1.3寸LCD屏幕,文末有简化前的代码及资料参考 1.需要软件有(如有需要留言,正常我每天都会看CSDN) 1.1开发环境, ...
- X、合宙Air模块Luat开发:全网首发,通过iic直接驱动OLED,720Sl开始有显时代
目录 点击这里查看所有博文 本系列博客,理论上适用于合宙的Air202.Air268.Air720x.Air720S以及最近发布的Air720U(我还没拿到样机,应该也能支持). 先不管支不支 ...
- 合宙Air724UG二次开发(1):搭建开发环境
合宙Air724UG二次开发(1):搭建开发环境 文章目录 合宙Air724UG二次开发(1):搭建开发环境 1. 系统环境 2. 嵌入式4G发展现状 3. 合宙Air724UG支持Lua开发实现原理 ...
- 【极创】arduino入门之ESP8266和ESP32开发板的arduino环境配置
一.前言 在这个万物智联时代,廉价的ESP系列芯片与开发板成为众多开发者首选,其内包含强大的无线通讯功能,可以满足开发者们绝大部分的开发需求. 二.ESP8266与ESP32开发板的arduino环境 ...
- 第0课第2节_刚接触开发板之烧写裸板程序
第0课第2节_刚接触开发板之烧写裸板程序 tftp用法 q //退出菜单 help tftp print //显示IP set ipaddr 192.168.31.203 //设置开发板IP set ...
- 003.0.96‘OLED+合宙ESP32C3+和风天气预报
合宙ESP32-C3+OLED天气预报 一.搭建开发框架 使用VScode platformio开发 1.oled显示 #include <Arduino.h> #include < ...
- 8、合宙Air模块Luat开发:基于官方库的二次封装,使串口更加易用
目录 点击这里查看所有博文 本系列博客,理论上适用于合宙的Air202.Air268.Air720x.Air720S以及最近发布的Air720U(我还没拿到样机,应该也能支持). 先不管支不支持,如果 ...
- Arduino手动添加ESP32相关开发板(图文并茂)
一.前述 使用Arduino开发ESP32,就绕不开添加ESP32开发板这一步,网上有很多相关教程,介绍的很详细,但是在实际操作过程中还是遇到一些问题,所以在这里记录一下,希望可以帮到别人. ...
最新文章
- Jaspersoft Studio简介
- 的计时器设置_【教程】PPT课件中常见的计时器效果(2)——沙漏式计时器 | 源文件提供下载...
- PHP 获取JSON json_decode返回NULL解决办法
- 分支管理---解决冲突
- Intent七大属性之总结
- MyBatis中if,where,set标签
- java 时分秒格式小时8_Java里得到00:00:00格式的时分秒的Timestamp
- 搭建微服务_快速搭建 SpringCloud 微服务开发环境的脚手架
- (二)注册服务提供者
- Python项目实践:霍兰德人格分析雷达图
- Log4j中的AsyncAppender的实现原理
- FPGA数字信号处理(十七)多级CIC滤波器Verilog设计
- mysql修改information_schema表时的错误
- 聚合物-化学键-聚合物PEG-Hyd-PDLLA /PLA-PHis-hyd-PEG/PEG-PUSeSe-PEG
- php cgi sapi
- R语言——数据清洗之缺失值处理
- ios8在通用设置中文键盘无效的解决方法(中文键盘设置)
- 兄弟们,我又回来了,干货太多让你们久等了
- python分段函数求值域_函数定义域,值域求法以及分段函数
- linux中systemd服务介绍