Closed MattMills closed 3 years ago
Hi @MattMills ,
Thanks for reporting this. Clearly I didn't test that example thoroughly enough!
Removing the ,2
after the mySensor.getSensorAltitude()
will fix that. The altitude is returned as an integer, not a float, so the ,2
is making it print in binary, not to two decimal places.
That part of the example should be:
Serial.print(F("Sensor altitude is currently: "));
Serial.println(mySensor.getSensorAltitude()); // Print the sensor altitude
mySensor.setSensorAltitude(1000); // Set the sensor altitude to 1000m
Serial.print(F("Sensor altitude is now: "));
Serial.println(mySensor.getSensorAltitude()); // Print the sensor altitude
Best wishes, Paul
Corrected in v1.0.2 Closing...
1111101000 == 1000 so I guess it's technically right?