import time from adafruit_circuitplayground import cp """-----------------------------------Do not touch---------------------------------------""" color={ 'white':(255, 255, 255), 'red':(50, 0, 0), 'yellow':(248, 150, 3), 'blue':(0, 0, 50) } """-----------------------------------Do not touch---------------------------------------""" '''---------------------Can Edit------------------''' ### Change dictionary key to desired color (default ['white']) ### Choose from white, red, blue, yellow light_color = color['blue'] #<---- Choose color inside [''] ### Choose delay in seconds time_delay = 1 #<---- adjust to time needed in seconds '''---------------------Can Edit------------------''' """-----------------------------------Do not touch---------------------------------------""" if light_color == color['white']: cp.pixels.brightness = 0.2 elif light_color == color['yellow']: cp.pixels.brightness = 0.1 else: cp.pixels.birghtness = 1 while True: cp.pixels.fill(light_color) time.sleep(time_delay) cp.pixels.fill(0) time.sleep(time_delay)
test
![](/assets/playground/adafruit_playground_1200x900-699010177a4a3fd6bac6bc31deae0bfa3eb9ea777ba62aaa5cbc1225bb45bfcc.jpg)
Adafruit Playground is a wonderful place to share what you find interesting. Have a cool project you are working on? Have a bit of code that you think others will find useful? Want to show off your electronics workbench? You have come to the right place.
Adafruit Playground is a safe place to share with the wonderful Adafruit community of makers and doers.
Click here to learn more about Adafruit Playground and how to get started.
This page (test) was last updated on February 01, 2024.
Text editor powered by tinymce.