Created
April 28, 2016 11:53
-
-
Save lesp/4bcaa350bce7769ad3ff68409b0c31fb to your computer and use it in GitHub Desktop.
Function to handle the colour of the LEDs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def neo(color,n): | |
if color == "pink": | |
for i in range(150): | |
strip.setPixelColor(i,Color(20,255,147)) | |
strip.show() | |
sleep(n) | |
for i in range(150): | |
strip.setPixelColor(i,Color(0,0,0)) | |
strip.show() | |
elif color == "green": | |
for i in range(150): | |
strip.setPixelColor(i,Color(255,0,0)) | |
strip.show() | |
sleep(n) | |
for i in range(150): | |
strip.setPixelColor(i,Color(0,0,0)) | |
strip.show() | |
elif color == "blue": | |
for i in range(150): | |
strip.setPixelColor(i,Color(0,0,255)) | |
strip.show() | |
sleep(n) | |
for i in range(150): | |
strip.setPixelColor(i,Color(0,0,0)) | |
strip.show() | |
elif color == "yellow": | |
for i in range(150): | |
strip.setPixelColor(i,Color(255,255,0)) | |
strip.show() | |
sleep(n) | |
for i in range(150): | |
strip.setPixelColor(i,Color(0,0,0)) | |
strip.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment