Skip to content

Commit

Permalink
Add formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
DocGarbanzo committed Sep 21, 2024
1 parent ff8c890 commit 0a9369f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions donkeycar/parts/imu.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,21 @@ def shutdown(self):

if __name__ == "__main__":
import sys
from sys import stdout
count = 0
p = Mpu6050Ada()
while True:
try:
accel, gyro = p.run()
print(f"accel: ", ",".join(f"{x:+5.4f}" for x in accel),
" gyro: ", ",".join(f"{x:+5.4f}" for x in gyro))
out_str = f"\raccel: " + f",".join(f"{x:+5.4f}" for x in accel) + \
f"gyro: " + ",".join(f"{x:+5.4f}" for x in gyro)
stdout(out_str)
stdout.flush()
time.sleep(0.05)
count += 1
except KeyboardInterrupt:
break
stdout.write("\n")
sys.exit(0)

iter = 0
Expand Down

0 comments on commit 0a9369f

Please sign in to comment.