for i in range(1024):
pixels.append(tuple((0,0,0)))
+pixel_status = []
+for i in range(1024):
+ pixel_status.append(0)
+
strip.show()
print "Starting Server"
+
+def led_timeout(strip,pixel):
+ pixel_status[pixel] = time.time() + 30
+ for i in range(1024):
+ if (pixel_status[i] < time.time()) & (pixel_status[i] != 0):
+ strip.setPixelColor(i, Color(0,0,0))
+
while True:
data, addr = server.recvfrom(1024)
if data:
red=pixel_color[0]
green=pixel_color[1]
blue=pixel_color[2]
+ led_timeout(strip,int(color[1]))
if (int(elements[1])==0):
strip.setPixelColor(int(color[1]), Color(0,0,0))
if color[0]=="R":
sub led_timeout {
my ($user_data, $pixel) = @_;
- $led_timer[$pixel] = time() + 15;
+ $led_timer[$pixel] = time() + 30;
for (my $i=0; $i<1024; $i++) {
if (($led_timer[$i] < time()) && ($led_timer[$i]>0)) {