27 testColorGreen = 2 # 0b010 #00FF00
28 testColorCyan = 3 # 0b011 #00FFFF
29 testColorRed = 4 # 0b100 #FF0000
30 testColorMagenta = 5 # 0b101 #FF00FF
31 testColorYellow = 6 # 0b110 #FFFF00
32 testColorWhite = 7 # 0b111 #FFFFFF
33
34 # patterns used in grovepi.chainableRgbLed_patte
35 thisLedOnly = 0
36 allLedsExceptThis = 1
37 thisLedAndInwards = 2
38 thisLedAndOutwards = 3
39
40 try:
41
42 print "Test 1) Initialise"
43
44 # init chain of leds
45 grovepi.chainableRgbLed_init(pin, numleds)
46 time.sleep(.5)
47
48 # change color to green
49 grovepi.storeColor(0,255,0)
50 time.sleep(.5)
51
52 # set led 1 to green
53 grovepi.chainableRgbLed_pattern(pin, thisLed
54 time.sleep(.5)
55
56 # change color to red
57 grovepi.storeColor(255,0,0)
58 time.sleep(.5)
59
60 # set led 10 to red
61 grovepi.chainableRgbLed_pattern(pin, thisLed
62 time.sleep(.5)
63
64 # pause so you can see what happened
65 time.sleep(2)
66
67 # reset (all off)