Skip to content

Add space, update comments. #12

New issue

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

Merged
merged 1 commit into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/clue_height_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
clue_display[0].text = "Calculate height!"
clue_display[2].text = "Press A to reset"
clue_display[3].text = "initial height!"

while True:
if clue.button_a:
initial_height = clue.altitude
clue.pixel.fill(clue.RED)
else:
clue.pixel.fill(0)

clue_display[5].text = "Altitude: {:.1f} m".format(clue.altitude)
clue_display[7].text = "Height: {:.1f} m".format(clue.altitude - initial_height)
clue_display.show()
8 changes: 6 additions & 2 deletions examples/clue_temperature_humidity_monitor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Monitor customisable temperature and humidity ranges, with an optional alarm."""
"""Monitor customisable temperature and humidity ranges, with an optional audible alarm tone."""
from adafruit_clue import clue

# Set desired temperature range in degrees Celsius.
Expand All @@ -9,19 +9,23 @@
min_humidity = 20
max_humidity = 65

# Set to true to enable alarm warning.
# Set to true to enable audible alarm tone.
alarm_enable = False

clue_display = clue.simple_text_display(text_scale=3, colors=(clue.WHITE,))

clue_display[0].text = "Temperature &"
clue_display[1].text = "Humidity"

while True:
alarm = False

temperature = clue.temperature
humidity = clue.humidity

clue_display[3].text = "Temp: {:.1f} C".format(temperature)
clue_display[5].text = "Humi: {:.1f} %".format(humidity)

if temperature < min_temperature:
clue_display[3].color = clue.BLUE
alarm = True
Expand Down