Skip to content

Commit

Permalink
start LED go grrrrr
Browse files Browse the repository at this point in the history
  • Loading branch information
c4glenn committed Mar 1, 2024
1 parent eef7e96 commit 23f59be
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/grr_hardware_python/grr_hardware_python/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ def __init__(self) -> None:
self.tca = TCA9548A(self.i2c)

self.start_light_timer = self.create_timer(.1, self.start_light_checker)
self.back_sensor = TCS34725(self.tca.channels[0])
self.back_sensor = TCS34725(self.tca[1])

self.start_light_publisher = self.create_publisher(Bool, "/grr/start_light", 10)
self.line_array_timer = self.create_timer(.1, self.line_array_timer)

self.start_light_publisher = self.create_publisher(Bool, "/grr/start_light", 10)
self.declare_parameter('LED_Threshold', 100)

self.line_follower = Line_Follower(self.i2c)
Expand Down Expand Up @@ -149,7 +147,6 @@ def line_array(self):
def start_light_checker(self):
threshold = self.get_parameter('LED_Threshold').get_parameter_value().integer_value
color_rgb = self.back_sensor.color_rgb_bytes
self.get_logger().info(f"Color: {color_rgb}")
msg = Bool()
msg.data = color_rgb[0] >= threshold
self.start_light_publisher.publish(msg)
Expand Down

0 comments on commit 23f59be

Please sign in to comment.