astro-pi / python-sense-hat

Source code for Sense HAT Python library
https://sense-hat.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
505 stars 253 forks source link

Heading and orientation #103

Open gpabdo opened 3 years ago

gpabdo commented 3 years ago

I was hoping to use the sense hat for a robotics project, but it seems when I try and use both get_orientation_degrees() and get_compass() I mine as well use random.randrange(360)

while True:
  # Works great without the call to sense.get_compass()
  sense.set_imu_config( False, True, True )
  print( sense.get_orientation_degrees() )

  # When I add this, all readings become useless.
  print( sense.get_compass() )

Can anyone point out what I am doing wrong? Thanks!