thomaslavi wrote:. We know how to find the altitude but it would be helpful if we could know how to do this using python so that after the balloon peaks and starts falling the screen will display the max altitude.
There's a screen being carried up on the balloon? Is someone up there to look at it? If not, I would think that you'd dispense with frivolities, you'll likely get to a higher altitude.
In any case, if you don't care about the time altitude data and just want the highest altitude, why not something like the following, but in actual python, which this isn't really so much, well, kind of:
HILLINESS = # an unknown fudge
GROUND = getAltitude()
altitude = GROUND
highestAltitude = GROUND
flight = False
while not flight #wait for the balloon to be released
if altitude is greater than (GROUND + HILLINESS) then
flight = True
while flight
altitude = getAltitude()
if altitude is greater than highestAltitude then
highestAltitude = altitude
if altitude is less than (GROUND + HILLINESS) then
flight = False
print("The highest altitude was: ", highestAltitude)
Nevertheless, I'd be saving the information because you never know what is going to happen, you might not find the balloon for a week or it might just smash into something and reboot. So perhaps add in code to test when the balloon has gone down X feet from highestAltitude and then write to the sdcard the max height.