2 # -*- coding: iso-8859-15 -*-
6 from datetime import datetime
7 from wild_thumper.msg import *
13 def sensorReceived(msg):
17 if __name__ == "__main__":
18 rospy.init_node('christmas')
19 pub = rospy.Publisher('led_stripe', LedStripe, queue_size=10)
20 rospy.Subscriber("/sensors", Sensor, sensorReceived)
23 while not rospy.is_shutdown():
24 if light <= ldr_thres or val != 0:
26 if light <= ldr_thres and now.hour >= 18 and now.hour <= 22:
32 Led(4, randint(0, val), randint(0, val), randint(0, val)),
33 Led(5, randint(0, val), randint(0, val), randint(0, val)),
34 Led(6, randint(0, val), randint(0, val), randint(0, val)),
35 Led(7, randint(0, val), randint(0, val), randint(0, val))