Skip to content

Commit

Permalink
Add reading timer constant
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminwp18 committed Jun 8, 2024
1 parent 9807713 commit df2ea00
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pi/temp_sensor/temp_sensor/temp_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import tsys01

READING_TIMER_PERIOD = 0.5 # Seconds


class TempSensor(Node):

Expand All @@ -13,8 +15,7 @@ def __init__(self) -> None:
self.sensor = tsys01.TSYS01()
self.sensor.init()

timer_period = 0.1 # seconds
self.timer = self.create_timer(timer_period, self.timer_callback)
self.timer = self.create_timer(READING_TIMER_PERIOD, self.timer_callback)

def timer_callback(self) -> None:
try:
Expand Down

0 comments on commit df2ea00

Please sign in to comment.