Made tree display more random
[pi-xmas.git] / xmas_tree / twin_random.py
1 import tree2
2 import random
3
4 bottom_right_reds = [tree2.RR1, tree2.RR2, tree2.RR3, tree2.RR4, tree2.RR5, tree2.RR6]
5 bottom_left_reds = [tree2.LR1, tree2.LR2, tree2.LR3, tree2.LR4, tree2.LR5, tree2.LR6]
6
7 # note that we must tell setup() that we have a bicolour LED
8 tree2.setup() # you must always call setup() first!
9
10 # for _ in range(5):
11 while True:
12 leds_on = random.sample(tree2.POSSIBLE_LEDS, random.randint(1, 8))
13 tree2.leds_on_and_wait(leds_on, random.triangular(0.2, 1.0, 0.7))
14
15 tree2.all_leds_off() # extinguish all LED
16
17 # All done!
18 tree2.cleanup() # call cleanup() at the end
19