Created
June 14, 2017 15:18
-
-
Save jrbail01/e670cad11d1656f69446ecf0023f610d to your computer and use it in GitHub Desktop.
Sense HAT Orientation Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sense_hat import SenseHat | |
sense = SenseHat() | |
while True: | |
orientation = sense.get_orientation() | |
print "pitch = " + str(orientation['pitch']) | |
print "roll = " + str(orientation['roll']) | |
print "yaw = " + str(orientation['yaw']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Getting a syntax error on line 45, uncertain why other than the length of the if else statement combo, but I have extremely limited knowledge of python. Any suggestions?
pi@RPI-TempMon:~ $ sudo python enviro_phat.py
File "enviro_phat.py", line 45
if (temp_c > -15) and (temp_c < 100): streamer.log(":sunny: " + SENSOR_NAME + " Temperature(C)", temp_c) streamer.log(":sunny: Calibrated " + SENSOR_NAME + " Temperature(C)", temp_c_cal) else: temp_f = temp_c * 9.0 / 5.0 + 32.0 temp_f_cal = temp_c_cal * 9.0 / 5.0 + 32.0 # print("Temperature(F) = " + str("{0:.2f}".format(temp_f))) if (temp_f > 0) and (temp_f < 110):
^
SyntaxError: invalid syntax