コード例 #1
0
ファイル: sentimentstar.py プロジェクト: jonmad/SentimentStar
# Create and start new thread
thread1 = myThread(1, "Tweet Poller")
thread1.start()

try:
    while True:
        if (powerChanged):
            powerChanged = False
            if (power == "off"):
                star.off()
        if (tweetclassChanged):
            tweetclassChanged = False
            if (tweetclass == "br"):
                #print("brexit - blink")
                star.off()
                star.blink()
            elif (tweetclass == "co"):
                #print("covid - pulse")
                star.off()
                star.pulse()
            elif (tweetclass == "ch"):
                #print("christmas - random leds")
                #for led in leds:
                #	led.source_delay = 0.1
                #	led.source = random_values()
                #print("christmas - on")
                star.off()
                star.on()
            else:
                print("Unknown tweetclass: " + tweetclass)
        time.sleep(10)