def connect(): port = None busses = serial.tools.list_ports.comports(); for bus in busses: for potential_port in bus: if "usbmodem" in potential_port: port = potential_port if not port: sys.exit("Could not locate a Blinkyboard.") print "Blinkyboard found at: %s" % port bb = Blinkyboard(port, 60, 'WS2811', gamma=[1,1,1]) bb.allOff() bb.show() return bb
from Blinkyboard import Blinkyboard bb = Blinkyboard('/dev/cu.usbmodem1d11', 'WS2811') while True: for x in range(0, 60): bb.sendPixel(255, 255, 255) bb.show() for x in range(0, 60): bb.sendPixel(0, 0, 0) bb.show()
from Blinkyboard import Blinkyboard bb = Blinkyboard('/dev/cu.usbmodem1d11', 'WS2811') while True: for x in range(0, 60): bb.sendPixel(255,255,255) bb.show(); for x in range(0, 60): bb.sendPixel(0,0,0) bb.show()
tmp.close() img = Image.open("data.png") img = img.convert('RGB') end = time.time() + 60*30; delay = 0.75 yheight = 25 while (time.time() < end): for x in positions: r, g, b = img.getpixel((x, yheight)) #print r, g, b bb.sendPixel(r, g, b); bb.show() time.sleep(delay) for idx, x in enumerate(positions): r, g, b = img.getpixel((x, yheight)) if idx == 0: r = 0 g = 0 b = 0 bb.sendPixel(r, g, b); bb.show() time.sleep(delay) # time.sleep(60*30)