Initial commit of Xmas tree
[pi-xmas.git] / xmas_tree / example_twin.py
1 import tree2
2
3 bottom_right_reds = [tree2.RR1, tree2.RR2, tree2.RR3, tree2.RR4, tree2.RR5, tree2.RR6]
4 bottom_left_reds = [tree2.LR1, tree2.LR2, tree2.LR3, tree2.LR4, tree2.LR5, tree2.LR6]
5
6 # note that we must tell setup() that we have a bicolour LED
7 tree2.setup() # you must always call setup() first!
8
9 # All the red LEDs will be permanently illuminated and we rotate
10 # between the various colours for the bicolour LED at the top.
11 for i in range(1): # repeat 7 times
12 tree2.leds_on_and_wait(bottom_right_reds, 0.8) # top LED off
13 tree2.leds_on_and_wait(bottom_right_reds + [tree2.LBG], 0.8) # top LED green
14 tree2.leds_on_and_wait(bottom_right_reds + [tree2.LBR], 0.8) # top LED green
15 tree2.leds_on_and_wait(bottom_right_reds + [tree2.LBA], 0.8) # top LED green
16
17 tree2.leds_on_and_wait([], 0.8) # all LEDs off
18
19 tree2.leds_on_and_wait(bottom_left_reds, 0.8) # top LED off
20 tree2.leds_on_and_wait(bottom_left_reds + [tree2.RBG], 0.8) # top LED green
21 tree2.leds_on_and_wait(bottom_left_reds + [tree2.RBR], 0.8) # top LED green
22 tree2.leds_on_and_wait(bottom_left_reds + [tree2.RBA], 0.8) # top LED green
23
24 tree2.all_leds_off() # extinguish all LEDs
25
26 # All done!
27 tree2.cleanup() # call cleanup() at the end
28