millis() returns 4 byte integer, assigning it to a 2 byte integer will result a system fail after 65 seconds (although during testing this didn't happen?)

pull/2/head
xyqyear 2023-07-18 14:19:48 +08:00
parent 448b416aa2
commit 0f833603b6
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ void loop()
{
// there will only be a new data point every this many milliseconds
// so we don't need to check every loop
uint16_t currentMillis = millis();
uint32_t currentMillis = millis();
if (currentMillis - lastMillis > DATA_READ_INTERVAL)
{
lastMillis = currentMillis;