Page 1 of 1

how to record and display max altitude reached?

Posted: Mon Apr 25, 2016 3:16 pm
by thomaslavi
We would like to know how the max altitude that has been recorded on the way to the highest point reached can be displayed for the rest of the flight once the altitude starts to go down. 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.
:mrgreen:

Re: how to record and display max altitude reached?

Posted: Mon Apr 25, 2016 10:09 pm
by DougieLawson
Store your data in an SQL table and use

Code: Select all

SELECT alt, max(alt) from data_logging_table where ...;

Re: how to record and display max altitude reached?

Posted: Mon Apr 25, 2016 11:27 pm
by stderr
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.

Re: how to record and display max altitude reached?

Posted: Tue Apr 26, 2016 9:52 am
by daveake
If this is a Pi-In-The-Sky question, then the simplest is to enable gps logging, and open the gps.txt file when you recover the SD card.

Dave