From 814774bd9b12c97a23fa2e71b17ec469f06bf46f Mon Sep 17 00:00:00 2001 From: adrianTNT Date: Mon, 9 Nov 2020 18:17:10 +0200 Subject: [PATCH 1/2] Update millis.adoc changed variable named "time" to "my_time", because it was a conflict when compiling on ESP32 board; And it is not a good practice to define such generic variables that could be used in system variables. Using user variables like my_time and my_temp_sensor is much easier to understand for beginners and more intuitive, easier to differentiate from the system variables. --- Language/Functions/Time/millis.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Language/Functions/Time/millis.adoc b/Language/Functions/Time/millis.adoc index d031efded..ccf163b23 100644 --- a/Language/Functions/Time/millis.adoc +++ b/Language/Functions/Time/millis.adoc @@ -47,16 +47,16 @@ This example code prints on the serial port the number of milliseconds passed si [source,arduino] ---- -unsigned long time; +unsigned long my_time; void setup() { Serial.begin(9600); } void loop() { Serial.print("Time: "); - time = millis(); + my_time = millis(); - Serial.println(time); //prints time since program started + Serial.println(my_time); //prints time since program started delay(1000); // wait a second so as not to send massive amounts of data } ---- From 9112b289a04e41937da8526ad289c7c27f283499 Mon Sep 17 00:00:00 2001 From: adrianTNT Date: Mon, 30 Nov 2020 17:58:51 +0200 Subject: [PATCH 2/2] Update millis.adoc --- Language/Functions/Time/millis.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Language/Functions/Time/millis.adoc b/Language/Functions/Time/millis.adoc index ccf163b23..ea3b9ab4e 100644 --- a/Language/Functions/Time/millis.adoc +++ b/Language/Functions/Time/millis.adoc @@ -47,16 +47,16 @@ This example code prints on the serial port the number of milliseconds passed si [source,arduino] ---- -unsigned long my_time; +unsigned long myTime; void setup() { Serial.begin(9600); } void loop() { Serial.print("Time: "); - my_time = millis(); + myTime = millis(); - Serial.println(my_time); //prints time since program started + Serial.println(myTime); //prints time since program started delay(1000); // wait a second so as not to send massive amounts of data } ----