import time
from neopixel import *
LED_COUNT = 30 LED_PIN = 18 LED_FREQ_HZ = 800000 LED_DMA = 10 LED_BRIGHTNESS = 255 LED_INVERT = False LED_CHANNEL = 0
LED_STRIP = ws.SK6812W_STRIP
def colorWipe(strip, color, wait_ms=50):
for i in range(strip.numPixels()):
strip.setPixelColor(i, color)
strip.show()
time.sleep(wait_ms/1000.0)
if __name__ == '__main__':
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL, LED_STRIP)
strip.begin()
print ('Press Ctrl-C to quit.')
while True:
colorWipe(strip, Color(255, 0, 0), 0) time.sleep(2)
colorWipe(strip, Color(0, 255, 0), 0) time.sleep(2)
colorWipe(strip, Color(0, 0, 255), 0) time.sleep(2)
colorWipe(strip, Color(0, 0, 0, 255), 0) time.sleep(2)
colorWipe(strip, Color(255, 255, 255), 0) time.sleep(2)
colorWipe(strip, Color(255, 255, 255, 255), 0) time.sleep(2)