Browse Source

added esp-01 support, led turned off

pull/2/head
Vladimir Smagin 6 months ago
parent
commit
cad2717b70
1 changed files with 13 additions and 3 deletions
  1. 13
    3
      tm1640-ntp.ino

+ 13
- 3
tm1640-ntp.ino View File

@@ -10,8 +10,13 @@

#define ONBOARDLED 2 // Built in LED on ESP-12/ESP-07

#define CLK D2
#define DIO D3
// ESP-12
//#define CLK D2
//#define DIO D3

// ESP-01
#define CLK D3
#define DIO D9

LM1640Display display(CLK, DIO);

@@ -65,10 +70,15 @@ NTPSyncEvent_t ntpEvent;
void setup() {
static WiFiEventHandler e1, e2, e3;
Wire.begin();
pinMode(ONBOARDLED, OUTPUT); // Onboard LED
digitalWrite(ONBOARDLED, LOW);
delay(1000);
digitalWrite(ONBOARDLED, HIGH);

//Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.hostname("clock16");
WiFi.hostname("clock-x16");
WiFi.begin(YOUR_WIFI_SSID, YOUR_WIFI_PASSWD);

pinMode(ONBOARDLED, OUTPUT); // Onboard LED

Loading…
Cancel
Save