What would be the best way to go about this?
you should read the blink without delay example that should help you
a quick dump of your list into code with functions that need to be elaborated.
unsigned long T1 = 20;
unsigned long T2 = 100;
long p = 0;
void loop()
{
// 50 / sec items
if (millis() - T1 > lastPressureTime)
{
lastPressureTime += T1;
p += readPressure();
}
// 10/sec items
if (millis() - T2 > lastAverageTime)
{
lastAverageTime+= T1;
pressure = p/5;
p = 0; // reset
altitude = calcAltitude(pressure);
writeEEprom(altitude); // wears out if written too often ... consider an external eeprom that can be replaced)
flag = checkLiftOffOccured();
if ((altitude < highest && parachuteClosed() ) || (altitude >= presetAltitude))
{
doParachute();
}
highest = max(altitude, highest);
if (touchDown())
{
exit();
}
}
this is incomplete code but it gives you an idea how it is done. The functions must be written still or can be replaced by the actual code .
Succes!