Skip to content

Commit

Permalink
Accelerometer on 4 lines in post
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewWilkes committed May 31, 2022
1 parent 171f600 commit b552e41
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ def on_activate(self):
window.println(f"Wifi: {wifi.get_sta_status()}")
window.println(f"IP: {wifi.get_ip()}")
try:
pos = accelerometer.get_xyz()
x,y,z = accelerometer.get_xyz()
except OSError:
pos = None
window.println(f"Accel: {pos}")
x = y = z = None
window.println("Accel")
window.println(f"X: {x}")
window.println(f"Y: {y}")
window.println(f"Z: {z}")

0 comments on commit b552e41

Please sign in to comment.