Created
April 25, 2022 22:25
-
-
Save RajanRao12/bb125a5e1867981aa708b1a8e655280f to your computer and use it in GitHub Desktop.
Day two progress
This file contains hidden or 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
| import time | |
| import board | |
| import neopixel | |
| pixel_pin = board.D2 #the ring data is connected to this pin | |
| num_pixels = 12 #number of leds pixels on the ring | |
| pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3, auto_write=False) | |
| RED = (255, 0, 0) #RGB | |
| YELLOW = (255, 150, 0) | |
| GREEN = (0, 255, 0) | |
| CYAN = (0, 255, 255) | |
| BLUE = (0, 0, 255) | |
| PURPLE = (180, 0, 255) | |
| WHITE = (255,255,255) | |
| OFF = (0,0,0) | |
| ORANGEROBIN = (225,60,20) | |
| REDROBIN = (222,35,5) #yum | |
| while True: | |
| pixels.fill(ORANGEROBIN) | |
| pixels.show() | |
| time.sleep(0.25) | |
| pixels.fill(RED) | |
| pixels.show() | |
| time.sleep(0.25) | |
| pixels.fill(ORANGEROBIN) | |
| pixels.show() | |
| time.sleep(0.25) | |
| pixels[0] = RED | |
| pixels.show() #required to update pixels | |
| time.sleep(0.1) | |
| pixels[1] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[2] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[3] = RED | |
| pixels.show() #required to update pixels | |
| time.sleep(0.1) | |
| pixels[4] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[5] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[6] = RED | |
| pixels.show() #required to update pixels | |
| time.sleep(0.1) | |
| pixels[7] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[8] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[9] = RED | |
| pixels.show() #required to update pixels | |
| time.sleep(0.1) | |
| pixels[10] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[11] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[0] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[1] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[2] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[3] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[4] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[5] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[6] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[7] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[8] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[9] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[10] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[11] = YELLOW | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[0] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[1] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[2] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[3] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[4] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[5] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[6] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[7] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[8] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[9] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[10] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[11] = ORANGEROBIN | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[0] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[1] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[2] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[3] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[4] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[5] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[6] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[7] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[8] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[9] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[10] = RED | |
| pixels.show() | |
| time.sleep(0.1) | |
| pixels[11] = RED | |
| pixels.show() | |
| time.sleep(0.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment