Browse Source

added esp-01 support, led turned off

pull/2/head
Vladimir Smagin 1 week 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 @@
10 10
 
11 11
 #define ONBOARDLED 2 // Built in LED on ESP-12/ESP-07
12 12
 
13
-#define CLK D2
14
-#define DIO D3
13
+// ESP-12
14
+//#define CLK D2
15
+//#define DIO D3
16
+
17
+// ESP-01
18
+#define CLK D3
19
+#define DIO D9
15 20
 
16 21
 LM1640Display display(CLK, DIO);
17 22
 
@@ -65,10 +70,15 @@ NTPSyncEvent_t ntpEvent;
65 70
 void setup() {
66 71
   static WiFiEventHandler e1, e2, e3;
67 72
   Wire.begin();
73
+  
74
+  pinMode(ONBOARDLED, OUTPUT); // Onboard LED
75
+  digitalWrite(ONBOARDLED, LOW); 
76
+  delay(1000);
77
+  digitalWrite(ONBOARDLED, HIGH); 
68 78
 
69 79
   //Serial.begin(115200);
70 80
   WiFi.mode(WIFI_STA);
71
-  WiFi.hostname("clock16");
81
+  WiFi.hostname("clock-x16");
72 82
   WiFi.begin(YOUR_WIFI_SSID, YOUR_WIFI_PASSWD);
73 83
 
74 84
   pinMode(ONBOARDLED, OUTPUT); // Onboard LED

Loading…
Cancel
Save