We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I added some code in to display the rounded temp on the sensehat:
################################################################ sense = SenseHat() import time OFFSET_LEFT = 1 OFFSET_TOP = 2 NUMS =[1,1,1,1,0,1,1,0,1,1,0,1,1,1,1, # 0 0,1,0,0,1,0,0,1,0,0,1,0,0,1,0, # 1 1,1,1,0,0,1,0,1,0,1,0,0,1,1,1, # 2 1,1,1,0,0,1,1,1,1,0,0,1,1,1,1, # 3 1,0,0,1,0,1,1,1,1,0,0,1,0,0,1, # 4 1,1,1,1,0,0,1,1,1,0,0,1,1,1,1, # 5 1,1,1,1,0,0,1,1,1,1,0,1,1,1,1, # 6 1,1,1,0,0,1,0,1,0,1,0,0,1,0,0, # 7 1,1,1,1,0,1,1,1,1,1,0,1,1,1,1, # 8 1,1,1,1,0,1,1,1,1,0,0,1,0,0,1] # 9 # Displays a single digit (0-9) def show_digit(val, xd, yd, r, g, b): offset = val * 15 for p in range(offset, offset + 15): xt = p % 3 yt = (p-offset) // 3 sense.set_pixel(xt+xd, yt+yd, r*NUMS[p], g*NUMS[p], b*NUMS[p]) # Displays a two-digits positive number (0-99) def show_number(val, r, g, b): abs_val = abs(val) tens = abs_val // 10 units = abs_val % 10 if (abs_val > 9): show_digit(tens, OFFSET_LEFT, OFFSET_TOP, r, g, b) show_digit(units, OFFSET_LEFT+4, OFFSET_TOP, r, g, b)
######################################################### and further down in the script in the "# Print and stream section" these two lines:
######################################################### sense.clear() show_number(int(round(temp_calibrated_c)), 200, 0, 60) #########################################################
The text was updated successfully, but these errors were encountered:
Hey @jimmyeao this looks cool! If you're interested, fork this repo and issue a PR and we'll review to include it in our library!
Sorry, something went wrong.
No branches or pull requests
I added some code in to display the rounded temp on the sensehat:
#########################################################
and further down in the script in the "# Print and stream section" these two lines:
#########################################################
sense.clear()
show_number(int(round(temp_calibrated_c)), 200, 0, 60)
#########################################################
The text was updated successfully, but these errors were encountered: