Skip to content

connorff/led-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

led-list

Teach Python lists with a BlinkStick Flex! Each LED represents a list index which can change color and turn off.

Examples

Turn on all LEDs

from led_list import LEDList

# initialize list with all lights (32) colored white
l = LEDList(["white"] * 32)

Change specific index

from led_list import LEDList

# initialize list with all lights (32) colored white
l = LEDList(["white"] * 32)

# change first light to red
l[0] = "red"

# change second light to custom RGB value
l[1] = (255, 50, 50)

Turn off lights

from led_list import LEDList

# initialize list with all lights (32) colored white
l = LEDList(["white"] * 32)

# turn off every light sequentially
for x in range(len(l)):
    l[x] = "black"