Ejemplo n.º 1
0
def led_ring_pwm(port, led_on_list):
    led_ring = plus.LED_Ring(port)
    led_on_list = led_on_list.split(",")
    for x in range(0,len(led_on_list)):
        led_on_list[x] = int(led_on_list[x])
    #print (led_on_list[0])
    #print (led_on_list[1])
    #print (led_on_list[2])
    #print ('[0]==0:', led_on_list[0]==0)
    #print led_on_list, type(led_on_list)
    led_ring.on(led_on_list)
Ejemplo n.º 2
0
def led_ring_spin(port, style, direct, delay):
    led_ring = plus.LED_Ring(port)

    if style == "SINGLE":
        _ring = led_ring.SINGLE()
    if style == "STAR":
        _ring = led_ring.STAR()

    if direct == "cw":
        w = 0
    else:
        w = 1

    dt = float(delay)
    led_ring.spin(_ring, w, dt)
Ejemplo n.º 3
0
def led_ring_on(port, led_on_list):
    led_ring = plus.LED_Ring(port)
    led_on_list = led_on_list.encode('utf8')
    led_on_list = led_on_list.split(",")
    #print(led_on_list[0])
    #print (led_on_list[1])
    #print (led_on_list[2])
    #print ("[0]==false", led_on_list[0]=='false')
    #print led_on_list, type(led_on_list)
    for x in range(0,len(led_on_list)):
        if led_on_list[x] == 'false':
            led_on_list[x] = 0
        else:
            led_on_list[x] = 100
    print ("led_on_list: ", led_on_list)
    led_ring.on(led_on_list)
Ejemplo n.º 4
0
def led_ring_meter(port, value, bright):
    led_ring = plus.LED_Ring(port)
    value = float(value)
    bright = int(bright)
    led_ring.meter(value, bright)
Ejemplo n.º 5
0
def led_ring_breath(port, delay):
    led_ring = plus.LED_Ring(port)
    dt = float(delay)
    led_ring.breath(dt)