Skip to content
Snippets Groups Projects
Commit 3cdbce39 authored by ef1g21's avatar ef1g21
Browse files

Upload New File

parent ca9db8e0
No related branches found
No related tags found
No related merge requests found
from neopixel import Neopixel
import utime
led = Neopixel(1, 0, 28, "RGB") # 1 LED, state machine 0, GP28 pin, RGB colour mode
blue = (195, 0, 90)
#TODO: Add some predefined colours
while True:
print( "To switch off the LED enter 'off'")
print("Predefined colours are blue,red,green,yellow and pink")
user = input("Enter the colour if you want from predefined colours:" )
#TODO: Sanitise user input to remove spaces
if user == "blue":
#TODO: Switch on the LED to that particular colour
#TODO: Do the same for all the rest of your colours
elif user =="off":
led.set_pixel(0, (0,0,0))
led.show()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment