Skip to content

check for time passage doesn't handle rollover properly #2

Description

@bneedhamia

The line
if (now - previousWeightTimeMs > MS_PER_WEIGHT_READING) {
should instead read
if ((long) now - previousWeightTimeMs) > MS_PER_WEIGHT_READING) {
to match the pattern described in https://playground.arduino.cc/Code/TimingRollover

It's possible this bug is causing some of the symptoms of Issue #1, because that symptom appears after millis() may have rolled over.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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