Skip to content

Commit 4d58e74

Browse files
brentrubrentru
authored andcommitted
code, final fonts
1 parent c0d10f9 commit 4d58e74

4 files changed

Lines changed: 10478 additions & 5141 deletions

File tree

PyPortal_Azure_Plant_Monitor/code.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
PyPortal Azure IoT Plant Monitor
3-
===================================================
3+
====================================================
44
Log plant vitals to Microsoft Azure IoT with
55
your PyPortal
66
@@ -31,9 +31,7 @@
3131
esp32_reset = DigitalInOut(board.ESP_RESET)
3232
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
3333
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
34-
status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2) # Uncomment for Most Boards
35-
"""Uncomment below for ItsyBitsy M4"""
36-
#status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
34+
status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2)
3735
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light)
3836

3937
# Soil Sensor Setup
@@ -52,11 +50,9 @@
5250
moisture_level = ss.moisture_read()
5351
# read temperature
5452
temperature = ss.get_temp()
55-
# Todo: make this nicer looking
56-
print(moisture_level, temperature)
5753
# display soil sensor values on pyportal
5854
gfx.display_moisture(moisture_level)
59-
gfx.display_temp(temperature)
55+
temperature = gfx.display_temp(temperature)
6056
print('Sending data to Azure')
6157
gfx.display_azure_status('Sending data...')
6258
hub.send_device_message(temperature)
@@ -67,4 +63,4 @@
6763
print("Failed to get data, retrying\n", e)
6864
wifi.reset()
6965
continue
70-
time.sleep(15)
66+
time.sleep(60)

0 commit comments

Comments
 (0)