示例#1
0
def scroll(client, message, topic):
    print("message to scroll :" + str(message))
    buffer = []
    for i in range(0,8):
        buffer.append("        ")

    displayed = [buffer]
    for m in message:
        displayed.append(font.printChar(ord(m)))    

    # print(displayed)


    for i in range(0,8*(len(message) + 1)):
        a=[" "," "," "," "," "," "," "," "]
        for j in range(len(message),-1,-1):
            b=[" "," "," "," "," "," "," "," "]
            shiftBufferLeft(displayed[j],a,b)
            a=b
        #print(" display " + str(i))
        #print(displayed)
        m = toLED(displayed[0], chr(30) + chr(0) + chr(0)) 
        client.publish(topic,m)
	
        time.sleep(0.05)
示例#2
0
def scroll(client, message, topic):
    """
	client : clientmqtt
        message : message to scroll
        topic: topic on which we send the elements for scroll
    """
    print("message to scroll :" + str(message))
    buffer = []
    for i in range(0,8):
        buffer.append("        ")

    displayed = [buffer]
    for m in message:
        displayed.append(font.printChar(ord(m)))    

    # print(displayed)


    for i in range(0,8*(len(message) + 1)):
        a=[" "," "," "," "," "," "," "," "]
        for j in range(len(message),-1,-1):
            b=[" "," "," "," "," "," "," "," "]
            shiftBufferLeft(displayed[j],a,b)
            a=b
        #print(" display " + str(i))
        #print(displayed)
        m = toLED(displayed[0], colorToPixel(10,0,0)) 
        client.publish(topic,m)
	
        time.sleep(0.05)
示例#3
0
def scroll(client, message, topic):
    print("message to scroll :" + str(message))
    buffer = []
    for i in range(0, 8):
        buffer.append("        ")

    displayed = [buffer]
    for m in message:
        displayed.append(font.printChar(ord(m)))

    # print(displayed)

    for i in range(0, 8 * (len(message) + 1)):
        a = [" ", " ", " ", " ", " ", " ", " ", " "]
        for j in range(len(message), -1, -1):
            b = [" ", " ", " ", " ", " ", " ", " ", " "]
            shiftBufferLeft(displayed[j], a, b)
            a = b
        #print(" display " + str(i))
        #print(displayed)
        m = toLED(displayed[0], chr(30) + chr(0) + chr(0))
        client.publish(topic, m)

        time.sleep(0.05)
示例#4
0
def charSequence(char,color):
    e = font.printChar(char)
    return toLED(e,color)
示例#5
0
def charSequence(char, color):
    e = font.printChar(char)
    return toLED(e, color)
示例#6
0
def fadinfadout(client, topic,  char, color ):
    fadinfadoutBuffer(client, topic, font.printChar(char), color);
示例#7
0
def fading(client, topic,  char, color , r = 1):
    c = font.printChar(char) 
    fadingBuffer(client, topic, c, color, r)