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)
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)
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)
def charSequence(char,color): e = font.printChar(char) return toLED(e,color)
def charSequence(char, color): e = font.printChar(char) return toLED(e, color)
def fadinfadout(client, topic, char, color ): fadinfadoutBuffer(client, topic, font.printChar(char), color);
def fading(client, topic, char, color , r = 1): c = font.printChar(char) fadingBuffer(client, topic, c, color, r)