Skip to content

Instantly share code, notes, and snippets.

@lesp
Created April 28, 2016 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesp/4bcaa350bce7769ad3ff68409b0c31fb to your computer and use it in GitHub Desktop.
Save lesp/4bcaa350bce7769ad3ff68409b0c31fb to your computer and use it in GitHub Desktop.
Function to handle the colour of the LEDs
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