Code for detecting free fall and printing the duration of the last period of free fall