Skip to content

Commit

Permalink
Use float for divisor in temperature conversion
Browse files Browse the repository at this point in the history
This avoids truncating the resulting decimals causing every temperature to be _XX.53_ degrees.
  • Loading branch information
nickcoutsos authored Jul 27, 2016
1 parent 1ab54b3 commit 14b5e51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MPU6050.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_temp(self):

# Get the actual temperature using the formule given in the
# MPU-6050 Register Map and Descriptions revision 4.2, page 30
actual_temp = (raw_temp / 340) + 36.53
actual_temp = (raw_temp / 340.0) + 36.53

# Return the temperature
return actual_temp
Expand Down

0 comments on commit 14b5e51

Please sign in to comment.