3 # Some constants to identify each LED
11 ALL
= 1+2+4+8+16+32+64
14 tree
.setup() # you must always call setup() first!
16 # Pattern: flash each LED in turn
18 for i
in range(5): # repeat 5 times
19 tree
.leds_on_and_wait(L0
, 0.3) # LED 0 on for 0.3 seconds
20 tree
.leds_on_and_wait(L1
, 0.3) # LED 1 on for 0.3 seconds
21 tree
.leds_on_and_wait(L2
, 0.3) # etc.
22 tree
.leds_on_and_wait(L3
, 0.3)
23 tree
.leds_on_and_wait(L4
, 0.3)
24 tree
.leds_on_and_wait(L5
, 0.3)
25 tree
.leds_on_and_wait(L6
, 0.3)
28 tree
.all_leds_off() # extinguish all LEDs
31 tree
.cleanup() # call cleanup() at the end