コード例 #1
0
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, num_leds, 'LPD8806', gamma=[1, 1, 1])
    bb.allOff()
    return bb
コード例 #2
0
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()