Astronaut WiFi weather clock based on STM32 and ESP8266 (open source code)

        Foreword: This article is a hands-on teaching ESP8266 famous open source project - Astronaut WiFi Weather Clock , the difference is that this project uses STM32 as MCU . In the development process of the two, due to the characteristics of their respective chips ( clock frequency, memory size, etc. ), the development programs are very different, and many places need special design. The reason why the author uses STM32 for development is very simple. Although ESP8266 is better than STM32F1xx in terms of computing power and other aspects, the disadvantages are also obvious. It has too few pins and peripherals , and the scalability is general ( ESP32 is considered to have both advantages ). In addition, the astronaut WiFi weather clock of ESP8266 on the Internet has been open sourced very well, so try to implement it with STM32, which is also convenient for subsequent development with STM32. ( There is open source code at the end of the article! )

        Experimental hardware: STM32F103ZET6; 7-pin 1.3-inch TFT-LCD (240×240); ESP8266

        Hardware physical map:

        Effect picture:

Pin Connection:

LCD display pins:

VCC --> 3.3V

GND --> GND

CLK --> PA5

FROM --> PA5

RES --> PB0

DC --> PB1

CS --> PA4

ESP8266 module pins:

VCC --> 3.3V

GND --> GND

RX--> PB10

TX --> PB11

RST --> PB9

EN --> PB7

1. Introduction and use of ESP8266

1.1 Introduction to ESP8266

        ESP8266 is an ultra-low-power UART-WiFi transparent transmission module, with the industry's most competitive package size and ultra-low-power technology, designed for mobile devices and IoT applications, which can connect users' physical devices to Wi-Fi -On the Fi wireless network , carry out Internet or local area network communication to achieve networking functions.

        ESP8266 is a low-power WiFi chip designed by Shanghai Espressif Information Technology ( domestic ) , which integrates a complete TCP/IP protocol stack and MCU ( there are many ESP8266 models on the Internet, and they basically have networking functions, and some models can be used directly as MCUs ). The ESP8266 module is a serial WiFi module developed by Shenzhen Anxinke Company based on the ESP8266 chip (adding necessary peripheral circuits, serial port flash, on-board antenna, etc.), low cost, easy to use, and powerful.

Generally, the firmware of the module is damaged or the firmware of the module may be brushed by someone else. It needs to be erased or added to use it. The author's ESP8266 is because the routine of the Arduino IDE is programmed into it, and it cannot recognize the AT command. Flash back the AT firmware . Flashing firmware is risky! ! ! ( If you buy ESP8266 nodeMCU, you may need to flash AT firmware )

1.2 The bridge between hardware and network - ESP8266

        The ESP8266 module is the same as the serial Bluetooth JDY-31 module, and the serial WiFi module is another artifact to expand the functions of the microcontroller. The compact ESP8266 WiFi module communicates with the microcontroller through the serial port AT command to realize the serial port transparent transmission , which is very easy to get started ( some models of ESP8266 can be directly used as MCU, no need to communicate with other MCUs through the serial port ).

 Transparent transmission , also known as transparent transmission , specifically means " input is output (such as characters input from the serial port of the WiFi module will be transparently transmitted to the server)", the data does not change , and the conversion between different protocols (such as serial port to WiFi, Bluetooth, etc.) are done by the module . The user does not need to care about the internal implementation, so the module is "transparent" to the user and does not seem to exist (because the intermediate implementation principle can be ignored). A highly encapsulated module should hide internal implementation details and only provide external use interfaces.

        After the hardware is connected to the Internet, it is no longer " playing a single machine ". With the Socket network programming on the server side, you can play many things. So I think the WiFi module is a bridge between software (network programming) and hardware (MCU), and links the MCU (MCU) learned with Web knowledge.

Nowadays , concepts such as the Internet of Things are all "smart hardware" . The emergence of modules such as ESP8266 greatly reduces the difficulty of network development and further promotes technology decentralization. Moreover, by learning ESP8266/ESP32 and other modules, you can be familiar with a large number of network protocols such as TCP/IP, which is also very meaningful for the subsequent network development of Linux system boards.

1.3 ESP8266 use - AT command

        The AT command was first contacted on the Bluetooth module. The so-called AT command is essentially some special strings that play a controlling role . The module can be developed by using the source code API function through AT command control. The overall development speed is fast and the difficulty is low.

Note: The following only lists some of the most commonly used AT commands and their usage. For detailed parameters and usage instructions of the commands, please refer to the official documentation: ESP8266 AT Command Set .

Basic AT commands

instruction describe
AT Test AT startup
AT+RST restart the module
AT+GMR View version information

AT is the most common command used to test whether the module can accept commands normally. Send the command AT to the serial port in sscom. If you receive the OK returned by the module, it means that the AT command of the module can work normally. Send AT+GMR to check the version number of the AT command and SDK. Generally, the latest version of the command will add some new functions, and you can pay attention to the official update at any time.

WiFi function AT command

WiFi is the basis for hardware networking. Like other functions, here are only the required common commands. For more detailed command descriptions, please refer to the documentation.

instruction describe
AT+CWMODE Set WiFi mode (sta/AP/sta+AP)
AT+CWLAP Scan nearby AP information
AT+CWJAP connect to AP
AT+CWQAP Disconnect from AP
AT+CWSAP Set ESP8266 softAP configuration
AT+CWLIF Get the information of the station connected to the ESP8266 softAP

Regarding the WiFi mode , I want to explain here. In sta mode , the module is equivalent to a client . Like our mobile phone and tablet, it needs to connect to the router. In AP mode , the module is equivalent to a router , which transmits WiFi and is connected by others. ESP8266 supports the coexistence of two modes (the module factory default is AP mode). In addition, the scan WiFi command AT+CWLAP can only be used in sta mode, otherwise an ERRO error will be reported, and the same is true for the AT+CWJAP and AT+CWQAP commands.

STA mode connection WiFi demo

  1. Send  AT+CWMODE=1 the command to configure the module as sta mode (parameters 1, 2, and 3 correspond to modes sta, AP and sta/AP respectively).

  2. Send a command to scan the current nearby WiFi, and the module will return a list of available APs. AT+CWLAP 

  3. Use to connect to the specified router. For example, my WiFi in the library is "Wang" , and the password is "123456" . The command sent to actually connect to WiFi is  . AT+CWJAP="WiFi名称","WiFi密码"  AT+CWJAP="Wang","123456"

  4. The returned " WIFI CONNECTED " indicates that the connection is successful, and " WIFI GOT IP " means that the module is assigned an IP.

  5. Finally, the  AT+CWQAP disconnected WiFi can be used.

TCP/IP related AT commands

Transmission Control Protocol (English: Transmission Control Protocol, abbreviated as TCP ) is a connection-oriented, reliable, byte stream-based transport layer communication protocol, defined by IETF's RFC 793 . In the simplified OSI model of computer network, it completes the functions specified by the fourth layer transport layer, and the User Datagram Protocol (UDP) is another important transport protocol within the same layer. In the Internet protocol suite, the TCP layer is an intermediate layer above the IP layer and below the application layer. Reliable, pipe-like connections are often required between application layers of different hosts, but the IP layer does not provide such a streaming mechanism, but provides unreliable packet exchange.

We often talk about the Internet, how do the two devices connected to the Internet "communicate" with each other? TCP connection is one of the most commonly used methods. TCP is a connection-oriented transport layer protocol. Both parties must implement the TCP protocol. One party only needs the target IP address and port number to initiate a connection. Once the connection is established, it is like pulling a pipe between the two parties. Full-duplex (two-way simultaneous transmission and reception) communication is possible.

TCP is a transport layer protocol , which is encapsulated on the basis of the network layer IP protocol. And the implementation details of these encapsulations are irrelevant to us. We only need to use the relevant interfaces provided by the system , such as Socket in network programming. The ESP8266 module also implements the TCP/IP protocol stack. As a client, the module can easily use AT commands to initiate a TCP connection to the server. After connecting to the TCP server and enabling the transparent transmission mode, the data received by the serial port of the module will be transparently transmitted to the server through the TCP connection, thus completing the transmission of data from the hardware serial port to the program process through the network, realizing the combination of software and hardware.

instruction describe
AT+CIPSTATUS Query network connection information
AT+CIPMUX Set up multi-connection mode
AT+CIPSTART Establish TCP connection UDP transport or SSL connection
AT+CIPCLOSE Turn off TCP/UDP/SSL transport
AT+CIPMODE Set transparent transmission mode
AT+CIPSEND send data

Connect the WiFi module to the computer. After sscom determines that the AT command can be used normally , you can start to configure the TCP connection. The specific steps are as follows:

  1. Connect the module to WiFi according to the " sta mode connection WiFi demo " section above

  2. Enter the command  AT+CIPMUX=0 to set up a single connection

  3. Learn the local IP and port from the "Network Debugging Assistant", enter the command  AT+CIPSTART="TCP","192.168.43.140",1234 (the command parameters are the connection type, target IP address and port number respectively) to initiate a TCP connection request to the server, after the handshake is successful and the connection is established, the "Network Debugging" on the server side Assistant" will display the client IP and port information. At this time, both parties are ready to send and receive data ( according to the actual IP address that needs to be connected )

  4. Enter the command to enable transparent transmission mode AT+CIPMODE=1 

  5. Enter the command  AT+CIPSEND to enter the transparent transmission mode. At this time, the module will send all the data received from the serial port to the server from the TCP port. Similarly, the data received from the server will also be sent from the serial port of the module and printed to sscom. In this way, the WiFi module has truly become a bridge connecting the hardware and the network, realizing the protocol conversion from serial port to TCP.

The above is actually about the instructions that this project needs to use. The ESP8266 configuration code is as follows:

void esp8266_config(void)
{
		char str[200];
		sprintf(str, "AT+CWJAP=\"%s\",\"%s\"\r\n", WIFI_NAME, WIFI_PSW);
//		SendATCmd("+++", 500);				// 退出透传模式
		SendATCmd("AT\r\n", 2000);			// 测试ESP01模块是否存在
//		SendATCmd("AT+GMR\r\n",3000);	// 查看模块版本信息
		SendATCmd("AT+CWMODE=1\r\n", 2000);	// 开启STA+AP模式 ==================		
		SendATCmd("AT+RST\r\n", 3000);	
		SendATCmd(str, 10000);	// 连接无线路由器或者手机热点,等待10秒 ============
		SendATCmd("AT+CIPMUX=0\r\n", 2000);	// 关闭多连接
		SendATCmd("AT+CIPSTART=\"TCP\",\"api.seniverse.com\",80\r\n", 2000);	// 连接心知  天气TCP服务器
		SendATCmd("AT+CIPMODE=1\r\n", 500);	// 开启透传模式
		SendATCmd("AT+CIPSEND\r\n", 500);		// 开始透传
}

2. Use of Zhixin Weather API

        This project is a WiFi weather clock, which is inseparable from the need to read weather information from the web page. Here we use the well-known Zhixin weather in the industry .

2.1 Log in to the official website of XinzhiWeather and register

Friends who do not have an account can sign up by themselves, the process is very simple. If it is not for commercial use, Zhixin Weather is free and relatively conscientious (the website response rate is also very high ).

Click "Try Now for Free"

Click "Free Application" for the free version

After applying, you can view your private key (you need to save it yourself later)

2.1 Use of API functions

         At present, most of the network data calls are habitually calling the API interface functions of the data provider .

Re-click "Product" -> "Weather Data", click "View API Documentation" 

Click "Weather Live" to open the corresponding API interface document 

The interface address for viewing the live weather, and an example of the returned data result (you need to save it yourself and use it later)

(1) The search and use of the above-mentioned Zhixin Weather API interface functions are highly versatile, and the process of reading most of the network data is similar.

(2) Embedded development is generally developed in C language in most cases . Due to the limitations of C language, there is no direct dictionary type processing ( python ). Therefore, it is generally impossible to directly return JSON data from the server to ESP8266. decoded read. There are currently 2 ways to deal with it: ①, transplant CJSON to decode ; ② use tricks to compare strings (the method used this time) ;

        In the process of using the project, the API function that comes with Zhixin Weather is directly used. The general process of the project: after enabling the STA mode, after successfully connecting to the WiFi, access the server that executes the weather website through the TCP protocol, and send a specific API interface function, the server responds Then return the required result information.

3. UART serial communication

        The direct communication between STM32 as MCU and ESP8266 is simple UART (serial port) communication, which is still very similar to the Bluetooth module. How to use: connect the UART_RX of ESP8266 through the serial port UARTx_TX , and then the microcontroller sends the AT command set through the serial port. The data information received by ESP8266 from the server is also transmitted from UART_TX of ESP8266 to UARTx_RX of the microcontroller . In the follow-up, you only need to use your own method to parse the data received by the serial port , and then you can get the data information you want.

You can initially use the computer serial port to read the information returned by the MCU received from the ESP8266:

Fourth, CubeMX configuration

1. RCC is equipped with external high-speed crystal oscillator (higher precision) - HSE;

2. SYS configuration: Debug is set to Serial Wire ( otherwise it may cause the chip to self-lock );

3. GPIO configuration: SPI communication is simulated here, and EN and RST of ESP8266 are set;

4. RTC configuration: year, month, day, hour, minute and second;

5. UART1 and UART3 configuration: MCU communicates with computer and ESP8266 respectively (remember to open serial communication interruption);

6. Clock tree configuration 

7. Engineering configuration

Five, code and analysis

5.1 TFT-LCD display code

The LCD display part is actually a very basic operation. If you are not familiar with it, you can go to another article of the author to find out. The author here mainly points out the different places in the project. [Highly recommended] Various display implementations of TFT-LCD based on STM32 (detailed content including code) - Programmer Sought

5.1.1 UI Design

        The most important point in the WiFi weather clock - UI design , needs to design a lot of interface icons. The author spent a lot of time here, rummaging through GitHub and Visual China . Finally, I found a UI library that almost meets the author's requirements ( if you need it, you can leave an email in the comment area ), as follows:

 5.1.2 GIF animation implementation

        At present, due to the STM32's own memory, STM32 is actually not suitable for implementing GIF animations . Therefore, there is very little information and code in this area on the Internet. At present, the more mainstream methods: (1) enWin or Lvgl library to realize GIF animation; (2) read data from SD card to display .

        The author has used a stupid method to realize the GIF display here, that is, to loop through each frame of the GIF animation.

Use GIF separator to separate each frame of GIF animation ;

Then use Image2Lcd 2.9 (cracked version) to advance the pattern;

Change the modulo code into a 2-dimensional array , the first dimension is the number of frames , and the second dimension is the modulo of each frame of pictures .

After that, each frame of the GIF array is displayed in a loop , and the GIF animation display can be realized.

Code:

void showimage4(const unsigned char *p) 
{
  int i; 
	unsigned char picH,picL;

	Address_set(180,146,228,195);
	for(i=0;i<49*50;i++)
		{	
			picL=*(p+i*2);	
			picH=*(p+i*2+1);				
			LCD_WR_DATA(picH<<8|picL); 				
		}	
}


for(int a=0;a<11;a++)
{
    showimage4(gImage_1[a]);
}

5.2 ESP8266 code

Part of the EPS8266 code is mainly responsible for communicating with the target server after configuration, and of course, the information returned by the decoding server needs to be decoded.

5.2.1 ESP8266 configuration code (including UART processing)

UART callback handler:

/* USER CODE BEGIN 4 */
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(huart);
  /* NOTE: This function Should not be modified, when the callback is needed,
           the HAL_UART_TxCpltCallback could be implemented in the user file
   */
	if(huart == &huart1)
	{
		g_uart1_rx.buf[g_uart1_rx.size++] = aRxBuffer_rx1;   									
		if((g_uart1_rx.buf[g_uart1_rx.size-1] == 0x0A)&&(g_uart1_rx.buf[g_uart1_rx.size-2] == 0x0D))	
		{
			HAL_UART_Transmit(&huart1, (uint8_t *)&g_uart1_rx.buf, g_uart1_rx.size,0xFFFF);	
					while(HAL_UART_GetState(&huart1) == HAL_UART_STATE_BUSY_TX);			
			g_uart1_rx.size = 0;
			memset(g_uart1_rx.buf,0x00,sizeof(g_uart1_rx.buf));									
		}
		HAL_UART_Receive_IT(&huart1, (uint8_t *)&aRxBuffer_rx1, 1);						
	}
	if(huart == &huart3)
	{
		g_uart3_rx.buf[g_uart3_rx.size++] = aRxBuffer_rx3;   									
	
		if((g_uart3_rx.buf[g_uart3_rx.size-1] == 'K')&&(g_uart3_rx.buf[g_uart3_rx.size-2] == 'O'))	
		{
			HAL_UART_Transmit(&huart1, (uint8_t *)&g_uart3_rx.buf, g_uart3_rx.size,0xFFFF);	
				while(HAL_UART_GetState(&huart1) == HAL_UART_STATE_BUSY_TX);			
			g_uart3_rx.size = 0;
			memset(g_uart3_rx.buf,0x00,sizeof(g_uart3_rx.buf));									
		}
		else if((g_uart3_rx.buf[g_uart3_rx.size-2] == ']')&&(g_uart3_rx.buf[g_uart3_rx.size-1] == '}')
			&&(g_uart3_rx.buf[g_uart3_rx.size-3] == '}'))
		{
			HAL_UART_Transmit(&huart1, (uint8_t *)&g_uart3_rx.buf, g_uart3_rx.size,0xFFFF);	
			while(HAL_UART_GetState(&huart1) == HAL_UART_STATE_BUSY_TX);			//				
			strcpy(Data_buff,(char *)g_uart3_rx.buf);
			temp = 1;
			g_uart3_rx.size = 0;				
			memset(g_uart3_rx.buf,0x00,sizeof(g_uart3_rx.buf));									

		}
		HAL_UART_Receive_IT(&huart3, (uint8_t *)&aRxBuffer_rx3, 1);						
	}
	
}
/* USER CODE END 4 */

ESP8266.h (AT control):

#ifndef __ESP8266_H
#define __ESP8266_H

//#include "stdint.h"

//uint8_t aRxBuffer_rx1;			//接收中断缓冲
//uint8_t aRxBuffer_rx3;			//接收中断缓冲

//typedef struct {
//	uint16_t size;
//	uint8_t buf[1022]; // 接收缓冲数组
//} UART_RXDATA;

//UART_RXDATA g_uart1_rx;
//UART_RXDATA g_uart3_rx;

//char Data_buff[1022];

//char weather[10];				//存储天气

//uint8_t temperature[2]={0,0}; 		//储存最高气温和最低气温
//uint8_t temp = 0;

//需要连接的wifi账号和密码,需要修改,且WiFi频段不支持5GHz
#define WIFI_NAME "Wang"
#define WIFI_PSW    "123456"
 
心知天气api,注意key=后面需要替换成自己账号的密钥
//char *get="GET https://api.seniverse.com/v3/weather/daily.json?key=SkV9zIBpwJAOixrJZ&location=chongqing&language=en&unit=c\r\n";

//void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart);
void SendATCmd(char *cmd, int waitms); 
void esp8266_config(void);


#endif

ESP8266.c:

#include "esp8266.h"
#include "usart.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "lcd.h"


void SendATCmd(char *cmd, int waitms) 
{ // 发送AT指令给串口3
	if (NULL != cmd)
	{
		HAL_UART_Transmit(&huart3, (uint8_t *)cmd, strlen(cmd), 0xFFFF);	
		if (waitms > 0)
			HAL_Delay(waitms);  // 延时等待ESP01模块应答时间
	}
}

void esp8266_config(void)
{
		char str[200];
		sprintf(str, "AT+CWJAP=\"%s\",\"%s\"\r\n", WIFI_NAME, WIFI_PSW);
//		SendATCmd("+++", 500);				// 退出透传模式
		SendATCmd("AT\r\n", 2000);			// 测试ESP01模块是否存在
//		SendATCmd("AT+GMR\r\n",3000);	// 查看模块版本信息
		SendATCmd("AT+CWMODE=1\r\n", 2000);	// 开启STA+AP模式 ==================		
		SendATCmd("AT+RST\r\n", 3000);	
		SendATCmd(str, 10000);	// 连接无线路由器或者手机热点,等待10秒 ============
		SendATCmd("AT+CIPMUX=0\r\n", 2000);	// 关闭多连接
		SendATCmd("AT+CIPSTART=\"TCP\",\"api.seniverse.com\",80\r\n", 2000);	// 连接心知天气TCP服务器
		SendATCmd("AT+CIPMODE=1\r\n", 500);	// 开启透传模式
		SendATCmd("AT+CIPSEND\r\n", 500);		// 开始透传
	
		SendATCmd("GET https://api.seniverse.com/v3/weather/daily.json?key=SkV9zIBpwJAOixrJZ&location=zhenjiang&language=en&unit=c\r\n", 2000);
}

Note, try to replace key= with your own key, and location= can also be replaced with the letters of your own city.

5.2.2 ESP8266 information decoding

        This part of the author took a trick and used string comparison and pointer value operations.

strstr() function:

atoi() function:

Code:

			char *p;
			p =	strstr(Data_buff,"text_day");				//查找天气		
			sscanf(p+11,"%[^\"]",weather);	
//			LCD_ShowString(40,80,(uint8_t*)weather);			
			p = strstr(Data_buff,"high");								//查找气温
			temperature[0]=atoi(p+7);
			p = strstr(Data_buff,"low");
			temperature[1]=atoi(p+6);
//			LCD_ShowxNum2(45,40,temperature[1],2,24,0);
			LCD_ShowxNum2(160,207,temperature[0],2,24,0);

			//温度
			value = (temperature[1]+temperature[0])/2;
			LCD_ShowxNum2(52,160,value,2,24,0); 			

			//湿度
			p = strstr(Data_buff,"humidity");
			humidity=atoi(p+11);
			LCD_ShowxNum2(132,160,humidity,2,24,0);
			LCD_ShowNew(161,160,'%',24,0);
			
			if((strstr(weather,"Overcast")) || (strstr(weather,"Mostly Cloudy")) || (strstr(weather,"Partly Cloudy")) || strstr(weather,"Cloudy"))	
			{
				Overcast();
			}
			if((strstr(weather,"Sunny")) || (strstr(weather,"Clear")) || (strstr(weather,"Fair")))			//ÇçÌì
			{
				Sunny();
			}
			if((strstr(weather,"Shower")))				
			{
				Shower();
			}
			if((strstr(weather,"Thundershower")) || (strstr(weather,"Thundershower with Hail")))		
			{
				Thundershower();
			}
			if((strstr(weather,"Light rain")) || (strstr(weather,"Moderate Rain")))			
			{
				smallrain();
			}
			if((strstr(weather,"Heavy Rain")) || (strstr(weather,"Storm")) || (strstr(weather,"Heavy Storm")) || (strstr(weather,"Severe Storm")))		
			{
				Bigrain();
			}
			if((strstr(weather,"Ice Rain")) || (strstr(weather,"Sleet")) || (strstr(weather,"Snow Flurry")) || (strstr(weather,"Light Snow")) || (strstr(weather,"Moderate Snow")) || (strstr(weather,"Heavy Snow")) || (strstr(weather,"Snowstorm")))		
			{
				snow();
			}			

5.3 RTC code

rtcdisplay.h:

#ifndef __RTCDISPLAY_H
#define __RTCDISPLAY_H

void RTC_display();

#endif

rtcdisplay.c:

#include "rtcdisplay.h"
#include "rtc.h"
#include "lcd.h"

RTC_DateTypeDef GetData;  //获取日期结构体
RTC_TimeTypeDef GetTime;   //获取时间结构体

void RTC_display()				//RTC DISPLAY
{
	
	  /* Get the RTC current Time */
	  HAL_RTC_GetTime(&hrtc, &GetTime, RTC_FORMAT_BIN);
    /* Get the RTC current Date */
    HAL_RTC_GetDate(&hrtc, &GetData, RTC_FORMAT_BIN);
	
		/* Display date Format : yy/mm/dd */
//		OLED_ShowNum(0,0,2000+GetData.Year,4,16);			//year
//		OLED_ShowStr(35,30,".",2);
//		OLED_ShowNum(45,0,GetData.Month,2,16);				//month
//		OLED_ShowStr(60,30,".",2);
//		OLED_ShowNum(70,0,GetData.Date,2,16);			    //date
	
    /* Display time Format : hh:mm:ss */
		LCD_ShowxNum2(15,75,GetTime.Hours,2,60,0);				//hour
//		LCD_ShowNew(75,65,':',60,0);
		LCD_ShowxNum2(105,75,GetTime.Minutes,2,60,0);			//min
		LCD_ShowxNum2(180,105,GetTime.Seconds,2,32,0);			//seconds

}

The clock of the RTC is displayed here. The author also went to the Internet to find a special LED digital font. If you need the LED digital font library, you can also comment and leave a message, and the author will send you the installation script.

6. Project effect

Astronaut WIFI Weather Clock

7. Project code

Code address:  Astronaut WiFi Weather Clock (TFT-LCD) based on STM32 and ESP8266 - Embedded Documentation Resources - CSDN Library

If you don't have enough points, please follow it and leave an email in the comment area. The author will provide the source code and follow-up questions free of charge . Please, please follow a wave! ! !

Guess you like

Origin blog.csdn.net/black_sneak/article/details/125457998