Skip to content

Commit 2fb8eae

Browse files
author
brentru
committed
change var name
1 parent 60e8dfb commit 2fb8eae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/adafruit_io_mqtt/adafruit_io_pubsub_rp2040.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def on_led_msg(client, topic, message):
9797
# Subscribe to all messages on the led feed
9898
io.subscribe("led")
9999

100-
refresh_time = 0.0
100+
prv_refresh_time = 0.0
101101
while True:
102102
# Poll for incoming messages
103103
try:
@@ -108,7 +108,7 @@ def on_led_msg(client, topic, message):
108108
io.reconnect()
109109
continue
110110
# Send a new temperature reading to IO every 30 seconds
111-
if (time.monotonic() - refresh_time) > 30:
111+
if (time.monotonic() - prv_refresh_time) > 30:
112112
# take the cpu's temperature
113113
cpu_temp = cpu.temperature
114114
# truncate to two decimal points
@@ -118,4 +118,4 @@ def on_led_msg(client, topic, message):
118118
print("Publishing %s to temperature feed..." % cpu_temp)
119119
io.publish("temperature", cpu_temp)
120120
print("Published!")
121-
refresh_time = time.monotonic()
121+
prv_refresh_time = time.monotonic()

0 commit comments

Comments
 (0)