I'm trying to write a code for a DemoSat project where a servo will be activated on decent around 500 m.
I've attached my current code below (minus the servo stuff and using pressure since that's easier to manipulate that than altitude) but this is the general idea;
if (current_altitude>max_altitude){ //going up
float max_altitude = current altitude} //recording current alt as new max
if (current_altitude<500m and max_altitude>10000 m){ //Payload has come back to 500m after reaching 10000 m
activate servo}
Any suggestions?
max_alt_wip.ino (1.29 KB)