Enregistrer accélération pendant chute

from microbit import *
# Wait for button to be pressed to start recording.
while not button_a.was_pressed():
pass
with open('data.csv', 'w') as f:
for i in range(1000):
f.write('{},{},{},{}\n'.format(running_time(), accelerometer.get_x(), accelerometer.get_y(), accelerometer.get_z()))
sleep(100)