Skip to content

Odometer

Tiogaplanet edited this page Jul 15, 2026 · 3 revisions

The odometer tracks the distance MiP has traveled.


readDistanceTravelled()

float readDistanceTravelled()

Description

Read the current MiP odometer tally.

Parameters

None

Returns

The distance traveled (in centimeters) since the last reset.

Notes

  • MiP's odometer is similar to that in a car. It maintains the total tally of the distance traveled, even across power cycles.
  • The resetDistanceTravelled() function can be used to reset the odometer.

Example

  float cm = mip.readDistanceTravelled();
  Serial1.print(F("MiP has travelled "));
    Serial1.print(cm);
    Serial1.println(F(" cm since the last reset."));

resetDistanceTravelled()

void resetDistanceTravelled()

Description

Reset MiP's odometer. The current odometer distance measurement is available by calling the readDistanceTravelled() function.

Parameters

None

Returns

Nothing

Notes

  • MiP's odometer doesn't automatically reset during a power cycle.
  • You should call this function if you want to manually reset it.

Example

  float cm = mip.readDistanceTravelled();
  Serial1.print(F("MiP has traveled "));
    Serial1.print(cm);
    Serial1.println(F(" cm since the last reset."));

  mip.resetDistanceTravelled();

Clone this wiki locally