手机端连接NS,经常出现shuggah到后台运行,不自动更新,因此想到用物联网芯片ESP8266接个小液晶屏来看糖,这样可以不用时时通过手机来看糖了,在PDD上花30多块买了个ESP8266开发板带一个0.96寸的液晶屏,程序是在Arduino用C语言写的。替换一下WIFI的SSID和密码,以及NS的地址就可以用了,程序都是在CSDN和其他渠道搜别人的程序来修改的,个人不会写程序,所以功能比较简单。
#include <SPI.h>
#include <TFT_eSPI.h>
#include <Arduino.h>
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecureBearSSL.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
#include <cstring>
TFT_eSPI tft = TFT_eSPI();
WiFiUDP ntpUDP;
// Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this date
const uint8_t fingerprint[20] = {0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54,