Skip to content
Tiogaplanet edited this page Jul 15, 2026 · 3 revisions

It can be a touchy subject - ask for MiP's weight.


readWeight()

int8_t readWeight()

Description

Read MiP's current estimate of how much weight it is carrying.

Parameters

None

Returns

A signed integer representing how much it is tilted to keep its center of mass directly over the wheels. A positive value if it is front heavy and a negative value if it is back heavy.

Notes

  • MiP's weight updates may be lost if you are spending too much time sending output back to a serial monitor. See Limitations section above.

Example

void loop() {
  static int8_t lastWeight = -128;
  int8_t currentWeight = mip.readWeight();

  if (currentWeight != lastWeight) {
    Serial1.print(F("Weight = "));
      Serial1.println(currentWeight);
    lastWeight = currentWeight;
  }
}

Clone this wiki locally