예제 #1
0
 def get(self):
     start = time.time()
     pixels.power.on()
     while time.time() - start < 3:
         pixels.show([255] * 48)
         time.sleep(0.3)
         pixels.show([255, 0, 0] * 16)
         time.sleep(0.3)
     pixels.power.off()
     return "Success"
예제 #2
0
def thread_water():
    while True:
        if boolWaterlight == 1:
            data = [255, 0, 0, 0, 0, 0, 0, 0, 0]
            pixels.show(data)
            time.sleep(0.4)
            data = [0, 0, 0, 0, 255, 0, 0, 0, 0]
            pixels.show(data)
            time.sleep(0.4)
            data = [0, 0, 0, 0, 0, 0, 0, 0, 255]
            pixels.show(data)
            time.sleep(0.4)
            data = [0, 0, 0, 0, 0, 0, 0, 0, 0]
            pixels.show(data)
            time.sleep(0.4)
        else:
            time.sleep(1)
예제 #3
0
파일: demo1.py 프로젝트: jade1827/2Mic_RGB
import time
from pixels import Pixels, pixels
from alexa_led_pattern import AlexaLedPattern
from google_home_led_pattern import GoogleHomeLedPattern

if __name__ == '__main__':

    pixels.pattern = GoogleHomeLedPattern(show=pixels.show)

    while True:

        try:
            data =[255,0,0] * 3
            pixels.show(data)
            time.sleep(2)
            data =[0,255,0] * 3
            pixels.show(data)
            time.sleep(2)
            data =[0,0,255] * 3
            pixels.show(data)
            time.sleep(2)
            data =[255,0,255] * 3
            pixels.show(data)
            time.sleep(2)
            
            data =[0,0,0] * 3
            pixels.show(data)
            time.sleep(2)
            pixels.show(data)