You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* copies of the Software, and to permit persons to whom the Software is
11
-
* furnished to do so, subject to the following conditions:
12
-
*
13
-
* The above copyright notice and this permission notice shall be included in all
14
-
* copies or substantial portions of the Software.
15
-
*
16
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
-
* SOFTWARE.
23
-
*
24
-
* ThingPulse invests considerable time and money to develop these open source libraries.
25
-
* Please support us by buying our products (and not the clones) from
26
-
* https://thingpulse.com
27
-
*
28
-
*/
2
+
The MIT License (MIT)
29
3
4
+
Copyright (c) 2018 by ThingPulse, Daniel Eichhorn
5
+
6
+
Permission is hereby granted, free of charge, to any person obtaining a copy
7
+
of this software and associated documentation files (the "Software"), to deal
8
+
in the Software without restriction, including without limitation the rights
9
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+
copies of the Software, and to permit persons to whom the Software is
11
+
furnished to do so, subject to the following conditions:
12
+
13
+
The above copyright notice and this permission notice shall be included in all
14
+
copies or substantial portions of the Software.
15
+
16
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+
SOFTWARE.
23
+
24
+
ThingPulse invests considerable time and money to develop these open source libraries.
25
+
Please support us by buying our products (and not the clones) from
26
+
https://thingpulse.com
27
+
28
+
*/
29
+
30
+
// Install https://github.com/PaulStoffregen/Time
30
31
#include<TimeLib.h>
31
32
32
33
// Include the correct display library
@@ -69,21 +70,21 @@
69
70
// SH1106Brzo display(0x3c, D3, D5);
70
71
71
72
// Initialize the OLED display using Wire library
72
-
SSD1306Wire display(0x3c, D3, D5);
73
-
// SH1106Wire display(0x3c, D3, D5);
73
+
SSD1306Wire display(0x3c, SDA, SCL); // ADDRESS, SDA, SCL - SDA and SCL usually populate automatically based on your board's pins_arduino.h e.g. https://github.com/esp8266/Arduino/blob/master/variants/nodemcu/pins_arduino.h
74
+
// SH1106Wire display(0x3c, SDA, SCL);
74
75
75
76
OLEDDisplayUi ui ( &display );
76
77
77
78
int screenW = 128;
78
79
int screenH = 64;
79
-
int clockCenterX = screenW/2;
80
-
int clockCenterY = ((screenH-16)/2)+16;// top yellow part is 16 px height
80
+
int clockCenterX = screenW / 2;
81
+
int clockCenterY = ((screenH - 16) / 2) + 16; // top yellow part is 16 px height
81
82
int clockRadius = 23;
82
83
83
84
// utility function for digital clock display: prints leading 0
0 commit comments