Skip to content

Commit a3d38c2

Browse files
committed
Fix variable names conflict with time function
Using time as a variable name was causing compiling in the Arduino IDE to fail due to a conflict with the ESP8266 core's time() function.
1 parent 570fda6 commit a3d38c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Thing/CloudCloud/CloudCloud.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ WidgetLCD lcd(LCD_PIN);
6767
CloudState cloud_state;
6868
WiFiClient client;
6969
WeatherType current_weather;
70-
unsigned long time;
70+
unsigned long timestamp;
7171
bool force_update;
7272
uint8_t color_r;
7373
uint8_t color_g;
@@ -99,7 +99,7 @@ void setup() {
9999
// Define initial state
100100
cloud_state = CLOUD_WEATHER;
101101
setLEDs();
102-
time = millis();
102+
timestamp = millis();
103103
force_update == false;
104104
color_r = 0;
105105
color_g = 0;
@@ -224,9 +224,9 @@ void sendDisco() {
224224
void doWeather() {
225225

226226
// Only update every 30 seconds
227-
if ( ((millis() - time) >= 30000) || force_update ) {
227+
if ( ((millis() - timestamp) >= 30000) || force_update ) {
228228
force_update = false;
229-
time = millis();
229+
timestamp = millis();
230230
lcd.clear();
231231
lcd.print(0, 0, "WEATHER");
232232

0 commit comments

Comments
 (0)