
#include <NTPClient.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include "TM1637.h"
//TM1637 针脚定义
#define CLK 0
#define DIO 2
TM1637 tm1637(CLK,DIO);
// wifi 信息定义
const char *ssid = "haha";
const char *password = "haha12345678@";
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP,"ntp1.aliyun.com",60*60*8,30*60*1000);
int update = 0;
int delaycount= 20;
int currentHour = 88;
int currentMinute = 88;
void setup()
{
Serial.begin(9600);
tm1637.init();
tm1637.set(BRIGHT_TYPICAL);//BRIGHT_TYPICAL = 2,BRIGHT_DARKEST = 0,BRIGHTEST = 7;
WiFi.begin(ssid, password);
while ( WiFi.status() != WL_CONNECTED ) {
tm1637.point(POINT_ON);
infoTime(currentHour/10,currentHour%10,currentMinute/10,currentMinute%10);
delay ( 500 );
Serial.print ( "." );
}
timeClient.begin();
}
void loop()
{
if (update % 2 == 0)
{
tm1637.point(POINT_