There was an error while loading. Please reload this page.
1 parent cfad2e7 commit 5e1ccd6Copy full SHA for 5e1ccd6
1 file changed
src/clue/adafruit_clue.py
@@ -423,12 +423,16 @@ def altitude(self):
423
print("Altitude: {:.1f}m".format(clue.altitude))
424
"""
425
# National Oceanic and Atmospheric Administration (NOAA) formula for converting atmospheric pressure to pressure altitude.
426
- altitude = 44330 * (
427
- 1.0
+ OUTSIDE_MULTIPLER_CONSTANT = 44330
+ POWER_CONSTANT = 0.1903
428
+ WHOLE_CONSTANT = 1
429
+
430
+ altitude = OUTSIDE_MULTIPLER_CONSTANT * (
431
+ WHOLE_CONSTANT
432
- math.pow(
433
self.__state[CONSTANTS.CLUE_STATE.PRESSURE]
434
/ self.__state[CONSTANTS.CLUE_STATE.SEA_LEVEL_PRESSURE],
- 0.1903,
435
+ POWER_CONSTANT,
436
)
437
438
return altitude
0 commit comments