programmation:microbit:enregistrer_acceleration_pendant_chute

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
programmation:microbit:enregistrer_acceleration_pendant_chute [2020/10/23 14:19] physixprogrammation:microbit:enregistrer_acceleration_pendant_chute [2020/10/23 14:25] (Version actuelle) physix
Ligne 1: Ligne 1:
 ====== Enregistrer accélération pendant chute ====== ====== Enregistrer accélération pendant chute ======
 +
 +Dans Mu
  
 <sxh python> <sxh python>
Ligne 6: Ligne 8:
 # Wait for button to be pressed to start recording.\\ # Wait for button to be pressed to start recording.\\
 while not button_a.was_pressed():\\ while not button_a.was_pressed():\\
- pass\\+pass\\
 with open('data.csv', 'w') as f:\\ with open('data.csv', 'w') as f:\\
 for i in range(1000):\\ for i in range(1000):\\
Ligne 13: Ligne 15:
  
 </sxh> </sxh>
 +
 +Pour récupérer le fichier data.csv :
 +
 +{{:programmation:microbit:e2bd21c57f32eca42a9aff6be74e9baf.png}}
 +
 +Puis déplacer le fichier sur l'ordinateur :
 +
 +{{:programmation:microbit:e6d88cb0cd6eb8e6ed35d113160be6b8.png}}
 +
 +L'accélérometre : https://microbit-micropython.readthedocs.io/en/v1.0.1/accelerometer.html
 +
 +On lit la valeur en milli-g.
 +
 +1000 signifie 9,81m/s
 +
 +{{:programmation:microbit:ff155957eb0ae183181e2a840afbba0e.png}}
  
  
  • programmation/microbit/enregistrer_acceleration_pendant_chute.1603455565.txt.gz
  • Dernière modification : 2020/10/23 14:19
  • de physix