Skip to content

si470x_01_RDS.ino fails to work on Arduino Nano Matter board #10

@fpalfpal

Description

@fpalfpal

The code complies but does not work.
The problem is:

long elapsed = millis();   // global scope

void setup() {
}

void loop() {
}

Won't work in platforms where Rtos/something similar is running in the background.
So, other platforms must be also effected.
The correct code is:

unsigned long elapsed = 0;  //note: the timestamp must be unsigned to avoid the rollover bug after ~49 days.

void setup() {
  elapsed = millis();
}

void loop() {
  // use elapsed
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions