From df2ea00cc165a97651066d1c91d13c21c500652e Mon Sep 17 00:00:00 2001 From: benjaminwp18 <90342856+benjaminwp18@users.noreply.github.com> Date: Sat, 8 Jun 2024 14:56:23 -0400 Subject: [PATCH] Add reading timer constant --- src/pi/temp_sensor/temp_sensor/temp_sensor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pi/temp_sensor/temp_sensor/temp_sensor.py b/src/pi/temp_sensor/temp_sensor/temp_sensor.py index 9576bd71..3f99c9fc 100644 --- a/src/pi/temp_sensor/temp_sensor/temp_sensor.py +++ b/src/pi/temp_sensor/temp_sensor/temp_sensor.py @@ -4,6 +4,8 @@ import tsys01 +READING_TIMER_PERIOD = 0.5 # Seconds + class TempSensor(Node): @@ -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: