Skip to content

Commit

Permalink
Minor update to mpu main example function
Browse files Browse the repository at this point in the history
  • Loading branch information
slabua committed Mar 26, 2024
1 parent 8443cfc commit 9ebca06
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions OLED/picomotodash_mpu9250.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,20 +354,26 @@ def __exit__(self, exception_type, exception_value, traceback):


if __name__ == "__main__":
mpu9250 = MPU()
mpu = MPU()

try:
while True:
# print(
# "\r\n /-------------------------------------------------------------/ \r\n"
# )
# print(mpu9250.update())
mpu9250.update_mpu()
mpu.update_mpu()

# pitch, roll, heading = mpu9250.get_roll_pitch_v1(mpu9250.lowpass_pc)
print("roll " + str(mpu9250.roll))
print("pitch " + str(mpu9250.pitch))
print("heading " + str(mpu9250.heading))
# print("roll " + str(mpu.roll))
# print("pitch " + str(mpu.pitch))
# print("heading " + str(mpu.heading))

print(
"Heading, Roll, Pitch: {:7.3f} {:7.3f} {:7.3f}".format(
mpu.heading, mpu.roll, mpu.pitch
)
)

# pitch, roll = mpu9250.get_roll_pitch_v2(mpu9250.comp_pc)
# print(mpu9250.get_roll_pitch_v3(mpu9250.comp_pc))
Expand Down

0 comments on commit 9ebca06

Please sign in to comment.