add off function

This commit is contained in:
NuoDaJia02
2025-10-27 14:31:16 +08:00
parent 071aec3b6c
commit 382be86637

View File

@@ -117,9 +117,10 @@ class LedCommand(Node):
xcmd=msg.data
print('led cmd:',xcmd)
cmd,val=xcmd.split(',')
self.cur_color=cmd
self.cur_val=int(val)
self.update=1
if cmd in ['red','green','blue','cyan','yellow','purple','white','off']:
self.cur_color=cmd
self.cur_val=int(val)
self.update=1
###self.led_blink(cmd,int(val))
def main():
rclpy.init()