Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from neopixel import Neopixel
- import random
- import utime
- numpix = 256 #static value
- strip = Neopixel(numpix, 0, 0, "GRB") #RGB Matrix settings (Num pixels, machine state, GPIO, arrangement)
- strip.fill((0,0,0)) #clear the board on startup
- #setting up RGB settings
- red = (255, 0, 0)
- orange = (255, 50, 0)
- yellow = (255, 100, 0)
- pink = (255, 108, 210)
- green = (0, 255, 0)
- blue = (0, 0, 255)
- indigo = (100, 0, 90)
- violet = (200, 0, 100)
- blank = (0,0,0)
- white = (255, 255, 255)
- colors_rgb = [red, orange, yellow, green, blue, indigo, violet, pink]
- delay = 0.03
- strip.brightness(50) #global value for LED brightness from 1-100
- # lists of pixels in the side bars
- bar_1 = [14, 17, 18, 29, 30, 33, 34, 45, 46, 209, 210, 221, 222, 225, 226, 237, 238, 241]
- bar_2 = [19, 27, 28, 35, 36, 43, 44, 211, 212, 219, 220, 227, 228, 236]
- bar_3 = [26, 37, 42, 213, 218, 229]
- bar_4 = [38, 39, 40, 41, 216, 215, 214, 217]
- hoz_index = [0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98, 105, 112, 119, 126, 133] #index values for pix[] that represent the top most pixel of each column
- # list of pixels not including sides and unused top and bottom rows and also put into a non stupid order
- pix = [49, 50, 51, 52, 53, 54, 55, 62, 61, 60, 59, 58, 57, 56, 65, 66, 67, 68, 69, 70, 71, 78, 77, 76, 75, 74, 73,
- 72, 81, 82, 83, 84, 85, 86, 87, 94, 93, 92, 91, 90, 89, 88, 97, 98, 99, 100, 101, 102, 103, 110, 109, 108,
- 107, 106, 105, 104, 113, 114, 115, 116, 117, 118, 119, 126, 125, 124, 123, 122, 121, 120, 129, 130, 131,
- 132, 133, 134, 135, 142, 141, 140, 139, 138, 137, 136, 145, 146, 147, 148, 149, 150, 151, 158, 157, 156,
- 155, 154, 153, 152, 161, 162, 163, 164, 165, 166, 167, 174, 173, 172, 171, 170, 169, 168, 177, 178, 179,
- 180, 181, 182, 183, 190, 189, 188, 187, 186, 185, 184, 193, 194, 195, 196, 197, 198, 199, 206, 205, 204,
- 203, 202, 201, 200]
- def wipe(): #clears the board not including the side bars
- x = 0
- while x <= 215:
- if x in pix:
- strip.set_pixel(x, blank)
- x += 1
- strip.show()
- x = 0
- return
- def sidebar():
- # Side bar setup
- for x in bar_1:
- strip.set_pixel(x, red, 100)
- for x in bar_2:
- strip.set_pixel(x, yellow, 100)
- for x in bar_3:
- strip.set_pixel(x, blue, 100)
- for x in bar_4:
- strip.set_pixel(x, green, 100)
- strip.show()
- return
- def eq():
- #Graphic Equalizer
- count = 0
- rand_options = [5, 5, 5, 5, 6, 4, 4, 3, 3, 2, 2, 1, 1, 0]
- last_rand = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] #stores the last value for each column, so that the next loop can compare its last value. Initial values are placeholders.
- while count < 300:
- run_count = 0 #a number between 0-21 that tracks where we are in the loop
- for x in pix[0:140:7]: #find position of top most pixel to draw from
- if run_count == 19:
- run_count = 0
- x = pix.index(x)
- rand = random.choice(rand_options) #find a random choice from the list that determines the amplitude of the line drawn
- if last_rand[run_count] < rand: #compares the random choice for this loop to the last one, to figure out if the line needs clearing
- strip.set_pixel(pix[x], blank)
- strip.set_pixel(pix[x+1], blank)
- strip.set_pixel(pix[x+2], blank)
- strip.set_pixel(pix[x+3], blank)
- strip.set_pixel(pix[x+4], blank)
- strip.set_pixel(pix[x+5], blank)
- strip.set_pixel(pix[x+6], blank)
- last_rand[run_count] = rand #stores the random choice value to a list for comparison
- if rand == 0: #bad hardcoding follows
- strip.set_pixel(pix[x], red)
- strip.set_pixel(pix[x+1], red)
- strip.set_pixel(pix[x+2], orange)
- strip.set_pixel(pix[x+3], green)
- strip.set_pixel(pix[x+4], green)
- strip.set_pixel(pix[x+5], green)
- strip.set_pixel(pix[x+6], green)
- if rand == 1:
- strip.set_pixel(pix[x+1], red)
- strip.set_pixel(pix[x+2], orange)
- strip.set_pixel(pix[x+3], green)
- strip.set_pixel(pix[x+4], green)
- strip.set_pixel(pix[x+5], green)
- strip.set_pixel(pix[x+6], green)
- if rand == 2:
- strip.set_pixel(pix[x+2], orange)
- strip.set_pixel(pix[x+3], green)
- strip.set_pixel(pix[x+4], green)
- strip.set_pixel(pix[x+5], green)
- strip.set_pixel(pix[x+6], green)
- if rand == 3:
- strip.set_pixel(pix[x+3], green)
- strip.set_pixel(pix[x+4], green)
- strip.set_pixel(pix[x+5], green)
- strip.set_pixel(pix[x+6], green)
- if rand == 4:
- strip.set_pixel(pix[x+4], green)
- strip.set_pixel(pix[x+5], green)
- strip.set_pixel(pix[x+6], green)
- if rand == 5:
- strip.set_pixel(pix[x+5], green)
- strip.set_pixel(pix[x+6], green)
- if rand == 6:
- strip.set_pixel(pix[x+6], green)
- run_count += 1
- strip.show()
- utime.sleep(0.04)
- count += 1
- return
- def stars():
- #RGB Stars
- count = 0
- while count < 1000:
- strip.set_pixel(random.choice(pix), colors_rgb[random.randint(0, len(colors_rgb)-1)])
- strip.set_pixel(random.choice(pix), blank)
- count += 1
- strip.show()
- wipe()
- return
- def scanner():
- #Red scanner
- count = 0
- while count < 4:
- for x in reversed(hoz_index):
- if x == 0 or x == 133:
- pass
- else:
- for i in range(-7, 7):
- strip.set_pixel(pix[x+i], red)
- strip.show()
- utime.sleep(delay)
- for i in range(-7, 7):
- strip.set_pixel(pix[x+i], blank)
- for x in hoz_index:
- if x == 0 or x == 133:
- pass
- else:
- for i in range(0, 14):
- strip.set_pixel(pix[x+i], red)
- strip.show()
- utime.sleep(delay)
- for i in range(0, 14):
- strip.set_pixel(pix[x+i], blank)
- count += 1
- count = 0
- return
- def iloveDP(): #giggity
- #I Heart Daft Punk (This code is not efficent but the LEDs force me to with their shitty layout)
- loop = 0
- while loop < 1:
- #I
- for x in range(61, 79):
- strip.set_pixel(pix[x],blue)
- strip.set_pixel(pix[56],blue)
- strip.set_pixel(pix[57],blue)
- strip.set_pixel(pix[82],blue)
- strip.set_pixel(pix[83],blue)
- strip.show()
- utime.sleep(1.5)
- #clear
- wipe()
- #full size heart draw
- #Heart 1
- count = 0
- while count < 4:
- for x in range(8, 11):
- strip.set_pixel(pix[x],red)
- for x in range(14, 19):
- strip.set_pixel(pix[x],red)
- for x in range(21, 27):
- strip.set_pixel(pix[x],red)
- for x in range(29, 35):
- strip.set_pixel(pix[x],red)
- for x in range(36, 42):
- strip.set_pixel(pix[x],red)
- for x in range(42, 48):
- strip.set_pixel(pix[x],red)
- for x in range(49, 54):
- strip.set_pixel(pix[x],red)
- for x in range(57, 60):
- strip.set_pixel(pix[x],red)
- #Heart 2
- for x in range(8, 11):
- strip.set_pixel(pix[x+70],red)
- for x in range(14, 19):
- strip.set_pixel(pix[x+70],red)
- for x in range(21, 27):
- strip.set_pixel(pix[x+70],red)
- for x in range(29, 35):
- strip.set_pixel(pix[x+70],red)
- for x in range(36, 42):
- strip.set_pixel(pix[x+70],red)
- for x in range(42, 48):
- strip.set_pixel(pix[x+70],red)
- for x in range(49, 54):
- strip.set_pixel(pix[x+70],red)
- for x in range(57, 60):
- strip.set_pixel(pix[x+70],red)
- strip.show()
- utime.sleep(0.2)
- wipe()
- #small heart draw
- #Heart 1
- for x in range(16, 18):
- strip.set_pixel(pix[x],red)
- for x in range(22, 26):
- strip.set_pixel(pix[x],red)
- for x in range(30, 34):
- strip.set_pixel(pix[x],red)
- for x in range(37, 41):
- strip.set_pixel(pix[x],red)
- for x in range(43, 47):
- strip.set_pixel(pix[x],red)
- for x in range(51, 53):
- strip.set_pixel(pix[x],red)
- #Heart 2
- for x in range(16, 18):
- strip.set_pixel(pix[x+70],red)
- for x in range(22, 26):
- strip.set_pixel(pix[x+70],red)
- for x in range(30, 34):
- strip.set_pixel(pix[x+70],red)
- for x in range(37, 41):
- strip.set_pixel(pix[x+70],red)
- for x in range(43, 47):
- strip.set_pixel(pix[x+70],red)
- for x in range(51, 53):
- strip.set_pixel(pix[x+70],red)
- strip.show()
- utime.sleep(0.2)
- wipe()
- count += 1
- vert_pos = 133 #starting the text on the right
- # Draw D
- while vert_pos > -330:
- # Draw D
- for x in range(vert_pos, vert_pos+7): #I have to write one of these for every vertical draw, for the whole two words
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+7, vert_pos+14, 6):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+15, vert_pos+20, 4):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+23, vert_pos+26):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- #Draw A
- for x in range(vert_pos+36, vert_pos+42):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+42, vert_pos+47,3):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+49, vert_pos+54,3):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+57, vert_pos+63):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- #Draw F
- for x in range(vert_pos+70, vert_pos+77):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+77, vert_pos+81, 3):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+84, vert_pos+88, 3):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+91, vert_pos+92):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- #Draw T
- for x in range(vert_pos+105, vert_pos+106):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+112, vert_pos+113):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+119, vert_pos+126):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+126, vert_pos+127):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+133, vert_pos+134):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- #Draw P
- for x in range(vert_pos+168, vert_pos+175):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+175, vert_pos+180,3):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+182, vert_pos+187,3):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+190, vert_pos+192):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- #Draw U
- for x in range(vert_pos+203, vert_pos+209):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+216, vert_pos+217):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+223, vert_pos+224):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+224, vert_pos+230):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- #Draw N
- for x in range(vert_pos+238, vert_pos+245):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+247, vert_pos+248):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+255, vert_pos+256):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+263, vert_pos+264):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+266, vert_pos+273):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- #Draw K
- for x in range(vert_pos+280, vert_pos+287):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+290, vert_pos+291):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+295, vert_pos+297):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+298, vert_pos+300):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- for x in range(vert_pos+301, vert_pos+309,6):
- if x > 139 or x < 0: pass
- else:
- strip.set_pixel(pix[x],red)
- vert_pos = vert_pos - 7
- strip.show()
- wipe()
- loop += 1
- return
- def expanding_heart():
- count = 0
- while count < 4:
- #center heart
- for x in range(43, 46):
- strip.set_pixel(pix[x],red)
- for x in range(49, 54):
- strip.set_pixel(pix[x],red)
- for x in range(56, 62):
- strip.set_pixel(pix[x],red)
- for x in range(64, 70):
- strip.set_pixel(pix[x],red)
- for x in range(71, 77):
- strip.set_pixel(pix[x],red)
- for x in range(77, 83):
- strip.set_pixel(pix[x],red)
- for x in range(84, 89):
- strip.set_pixel(pix[x],red)
- for x in range(92, 95):
- strip.set_pixel(pix[x],red)
- strip.show()
- utime.sleep(0.05)
- wipe()
- #smaller heart
- for x in range(50, 53):
- strip.set_pixel(pix[x],red)
- for x in range(57, 61):
- strip.set_pixel(pix[x],red)
- for x in range(65, 69):
- strip.set_pixel(pix[x],red)
- for x in range(72, 76):
- strip.set_pixel(pix[x],red)
- for x in range(78, 82):
- strip.set_pixel(pix[x],red)
- for x in range(85, 88):
- strip.set_pixel(pix[x],red)
- strip.show()
- utime.sleep(0.05)
- #back to full heart
- for x in range(43, 46):
- strip.set_pixel(pix[x],red)
- for x in range(49, 54):
- strip.set_pixel(pix[x],red)
- for x in range(56, 62):
- strip.set_pixel(pix[x],red)
- for x in range(64, 70):
- strip.set_pixel(pix[x],red)
- for x in range(71, 77):
- strip.set_pixel(pix[x],red)
- for x in range(77, 83):
- strip.set_pixel(pix[x],red)
- for x in range(84, 89):
- strip.set_pixel(pix[x],red)
- for x in range(92, 95):
- strip.set_pixel(pix[x],red)
- strip.show()
- utime.sleep(0.05)
- #expansion ring green
- strip.set_pixel(pix[63], green)
- strip.set_pixel(pix[70], green)
- strip.set_pixel(pix[42], green)
- strip.set_pixel(pix[91], green)
- strip.set_pixel(pix[62], green)
- strip.set_pixel(pix[83], green)
- for x in range(46, 48):
- strip.set_pixel(pix[x],green)
- for x in range(95, 97):
- strip.set_pixel(pix[x],green)
- for x in range(46, 48):
- strip.set_pixel(pix[x],green)
- for x in range(54, 56):
- strip.set_pixel(pix[x],green)
- for x in range(89, 91):
- strip.set_pixel(pix[x],green)
- for x in range(98, 103):
- strip.set_pixel(pix[x],green)
- for x in range(35, 40):
- strip.set_pixel(pix[x],green)
- for x in range(29, 32):
- strip.set_pixel(pix[x],green)
- for x in range(106, 109):
- strip.set_pixel(pix[x],green)
- strip.show()
- utime.sleep(0.05)
- #expansion ring blue
- strip.set_pixel(pix[28], blue)
- strip.set_pixel(pix[105], blue)
- strip.set_pixel(pix[48], blue)
- strip.set_pixel(pix[97], blue)
- for x in range(40, 42):
- strip.set_pixel(pix[x],blue)
- for x in range(103, 105):
- strip.set_pixel(pix[x],blue)
- for x in range(32, 34):
- strip.set_pixel(pix[x],blue)
- for x in range(109, 111):
- strip.set_pixel(pix[x],blue)
- for x in range(21, 26):
- strip.set_pixel(pix[x],blue)
- for x in range(112, 117):
- strip.set_pixel(pix[x],blue)
- for x in range(15, 18):
- strip.set_pixel(pix[x],blue)
- for x in range(120, 123):
- strip.set_pixel(pix[x],blue)
- strip.show()
- utime.sleep(0.05)
- #expansion ring violet
- strip.set_pixel(pix[34], violet)
- strip.set_pixel(pix[111], violet)
- strip.set_pixel(pix[119], violet)
- strip.set_pixel(pix[14], violet)
- for x in range(117, 119):
- strip.set_pixel(pix[x],violet)
- for x in range(26, 28):
- strip.set_pixel(pix[x],violet)
- for x in range(18, 20):
- strip.set_pixel(pix[x],violet)
- for x in range(123, 125):
- strip.set_pixel(pix[x],violet)
- for x in range(126, 131):
- strip.set_pixel(pix[x],violet)
- for x in range(7, 12):
- strip.set_pixel(pix[x],violet)
- for x in range(1, 4):
- strip.set_pixel(pix[x],violet)
- for x in range(134, 137):
- strip.set_pixel(pix[x],violet)
- strip.show()
- utime.sleep(0.05)
- #expansion ring white
- strip.set_pixel(pix[0], white)
- strip.set_pixel(pix[133], white)
- strip.set_pixel(pix[125], white)
- strip.set_pixel(pix[20], white)
- for x in range(131, 133):
- strip.set_pixel(pix[x],white)
- for x in range(12, 14):
- strip.set_pixel(pix[x],white)
- for x in range(4, 6):
- strip.set_pixel(pix[x],white)
- for x in range(137, 139):
- strip.set_pixel(pix[x],white)
- strip.show()
- utime.sleep(0.05)
- #expansion ring yellow
- strip.set_pixel(pix[139], yellow)
- strip.set_pixel(pix[6], yellow)
- strip.show()
- utime.sleep(0.8)
- #Reverse the expanding heart
- #clear ring yellow
- strip.set_pixel(pix[139], blank)
- strip.set_pixel(pix[6], blank)
- strip.show()
- utime.sleep(0.05)
- #clear ring white
- strip.set_pixel(pix[0], blank)
- strip.set_pixel(pix[133], blank)
- strip.set_pixel(pix[125], blank)
- strip.set_pixel(pix[20], blank)
- for x in range(131, 133):
- strip.set_pixel(pix[x],blank)
- for x in range(12, 14):
- strip.set_pixel(pix[x],blank)
- for x in range(4, 6):
- strip.set_pixel(pix[x],blank)
- for x in range(137, 139):
- strip.set_pixel(pix[x],blank)
- strip.show()
- utime.sleep(0.05)
- #clear ring violet
- strip.set_pixel(pix[34], blank)
- strip.set_pixel(pix[111], blank)
- strip.set_pixel(pix[119], blank)
- strip.set_pixel(pix[14], blank)
- for x in range(117, 119):
- strip.set_pixel(pix[x],blank)
- for x in range(26, 28):
- strip.set_pixel(pix[x],blank)
- for x in range(18, 20):
- strip.set_pixel(pix[x],blank)
- for x in range(123, 125):
- strip.set_pixel(pix[x],blank)
- for x in range(126, 131):
- strip.set_pixel(pix[x],blank)
- for x in range(7, 12):
- strip.set_pixel(pix[x],blank)
- for x in range(1, 4):
- strip.set_pixel(pix[x],blank)
- for x in range(134, 137):
- strip.set_pixel(pix[x],blank)
- strip.show()
- utime.sleep(0.05)
- #clear ring blue
- strip.set_pixel(pix[28], blank)
- strip.set_pixel(pix[105], blank)
- strip.set_pixel(pix[48], blank)
- strip.set_pixel(pix[97], blank)
- for x in range(40, 42):
- strip.set_pixel(pix[x],blank)
- for x in range(103, 105):
- strip.set_pixel(pix[x],blank)
- for x in range(32, 34):
- strip.set_pixel(pix[x],blank)
- for x in range(109, 111):
- strip.set_pixel(pix[x],blank)
- for x in range(21, 26):
- strip.set_pixel(pix[x],blank)
- for x in range(112, 117):
- strip.set_pixel(pix[x],blank)
- for x in range(15, 18):
- strip.set_pixel(pix[x],blank)
- for x in range(120, 123):
- strip.set_pixel(pix[x],blank)
- strip.show()
- utime.sleep(0.05)
- #clear ring green
- strip.set_pixel(pix[63], blank)
- strip.set_pixel(pix[70], blank)
- strip.set_pixel(pix[42], blank)
- strip.set_pixel(pix[91], blank)
- strip.set_pixel(pix[62], blank)
- strip.set_pixel(pix[83], blank)
- for x in range(46, 48):
- strip.set_pixel(pix[x],blank)
- for x in range(95, 97):
- strip.set_pixel(pix[x],blank)
- for x in range(46, 48):
- strip.set_pixel(pix[x],blank)
- for x in range(54, 56):
- strip.set_pixel(pix[x],blank)
- for x in range(89, 91):
- strip.set_pixel(pix[x],blank)
- for x in range(98, 103):
- strip.set_pixel(pix[x],blank)
- for x in range(35, 40):
- strip.set_pixel(pix[x],blank)
- for x in range(29, 32):
- strip.set_pixel(pix[x],blank)
- for x in range(106, 109):
- strip.set_pixel(pix[x],blank)
- strip.show()
- utime.sleep(0.8)
- count += 1
- return
- def eyes():
- count = 0
- shifty = 0
- open_time = 0.3 #slow first open
- while count < 5:
- def blink(): #blink the eyes
- strip.set_pixel(pix[8],blank)
- strip.set_pixel(pix[43],blank)
- strip.set_pixel(pix[19],blank)
- strip.set_pixel(pix[26],blank)
- strip.set_pixel(pix[33],blank)
- strip.set_pixel(pix[40],blank)
- strip.set_pixel(pix[92],blank)
- strip.set_pixel(pix[127],blank)
- strip.set_pixel(pix[103],blank)
- strip.set_pixel(pix[110],blank)
- strip.set_pixel(pix[117],blank)
- strip.set_pixel(pix[124],blank)
- strip.show()
- utime.sleep(0.001)
- for x in range(2, 5, 2):
- strip.set_pixel(pix[x],blank)
- for x in range(9, 12, 2):
- strip.set_pixel(pix[x],blank)
- strip.set_pixel(pix[18],blank)
- strip.set_pixel(pix[23],blank)
- strip.set_pixel(pix[30],blank)
- strip.set_pixel(pix[39],blank)
- for x in range(44, 47, 2):
- strip.set_pixel(pix[x],blank)
- for x in range(51, 54, 2):
- strip.set_pixel(pix[x],blank)
- for x in range(86, 89, 2):
- strip.set_pixel(pix[x],blank)
- for x in range(93, 96, 2):
- strip.set_pixel(pix[x],blank)
- strip.set_pixel(pix[102],blank)
- strip.set_pixel(pix[107],blank)
- strip.set_pixel(pix[114],blank)
- strip.set_pixel(pix[123],blank)
- for x in range(128, 131, 2):
- strip.set_pixel(pix[x],blank)
- for x in range(135, 138, 2):
- strip.set_pixel(pix[x],blank)
- strip.show()
- utime.sleep(0.001)
- wipe()
- #draw eyes opening
- strip.set_pixel(pix[10],red)
- strip.set_pixel(pix[17],red)
- strip.set_pixel(pix[31],blue)
- strip.set_pixel(pix[38],blue)
- strip.set_pixel(pix[52],red)
- strip.set_pixel(pix[59],red)
- strip.set_pixel(pix[80],red)
- strip.set_pixel(pix[87],red)
- strip.set_pixel(pix[101],blue)
- strip.set_pixel(pix[108],blue)
- strip.set_pixel(pix[122],red)
- strip.set_pixel(pix[129],red)
- strip.show()
- utime.sleep(open_time)
- for x in range(9, 12, 2):
- strip.set_pixel(pix[x],red)
- for x in range(16, 19, 2):
- strip.set_pixel(pix[x],red)
- strip.set_pixel(pix[25],red)
- strip.set_pixel(pix[30],blue)
- strip.set_pixel(pix[37],blue)
- strip.set_pixel(pix[46],red)
- for x in range(51, 54, 2):
- strip.set_pixel(pix[x],red)
- for x in range(58, 61, 2):
- strip.set_pixel(pix[x],red)
- for x in range(79, 82, 2):
- strip.set_pixel(pix[x],red)
- for x in range(86, 89, 2):
- strip.set_pixel(pix[x],red)
- strip.set_pixel(pix[95],red)
- strip.set_pixel(pix[100],blue)
- strip.set_pixel(pix[107],blue)
- strip.set_pixel(pix[116],red)
- for x in range(121, 124, 2):
- strip.set_pixel(pix[x],red)
- for x in range(128, 131, 2):
- strip.set_pixel(pix[x],red)
- strip.show()
- utime.sleep(open_time)
- strip.set_pixel(pix[15],red)
- strip.set_pixel(pix[50],red)
- strip.set_pixel(pix[26],red)
- strip.set_pixel(pix[33],red)
- strip.set_pixel(pix[40],red)
- strip.set_pixel(pix[47],red)
- strip.set_pixel(pix[85],red)
- strip.set_pixel(pix[120],red)
- strip.set_pixel(pix[96],red)
- strip.set_pixel(pix[103],red)
- strip.set_pixel(pix[110],red)
- strip.set_pixel(pix[117],red)
- strip.show()
- if shifty == 0:
- utime.sleep(1.5)
- strip.set_pixel(pix[30],blank)
- strip.set_pixel(pix[31],blank)
- strip.set_pixel(pix[100],blank)
- strip.set_pixel(pix[101],blank)
- strip.set_pixel(pix[44],blue)
- strip.set_pixel(pix[45],blue)
- strip.set_pixel(pix[114],blue)
- strip.set_pixel(pix[115],blue)
- strip.show()
- utime.sleep(0.8)
- strip.set_pixel(pix[44],blank)
- strip.set_pixel(pix[45],blank)
- strip.set_pixel(pix[114],blank)
- strip.set_pixel(pix[115],blank)
- strip.set_pixel(pix[37],blank)
- strip.set_pixel(pix[38],blank)
- strip.set_pixel(pix[107],blank)
- strip.set_pixel(pix[108],blank)
- for x in range(23, 25):
- strip.set_pixel(pix[x],blue)
- for x in range(30, 32):
- strip.set_pixel(pix[x],blue)
- for x in range(93, 95):
- strip.set_pixel(pix[x],blue)
- for x in range(100, 102):
- strip.set_pixel(pix[x],blue)
- strip.show()
- utime.sleep(1.5)
- strip.set_pixel(pix[30],blank)
- strip.set_pixel(pix[31],blank)
- strip.set_pixel(pix[100],blank)
- strip.set_pixel(pix[101],blank)
- strip.set_pixel(pix[23],blank)
- strip.set_pixel(pix[24],blank)
- strip.set_pixel(pix[93],blank)
- strip.set_pixel(pix[94],blank)
- strip.set_pixel(pix[37],blue)
- strip.set_pixel(pix[38],blue)
- strip.set_pixel(pix[44],blue)
- strip.set_pixel(pix[45],blue)
- strip.set_pixel(pix[107],blue)
- strip.set_pixel(pix[108],blue)
- strip.set_pixel(pix[114],blue)
- strip.set_pixel(pix[115],blue)
- strip.show()
- utime.sleep(0.5)
- strip.set_pixel(pix[44],blank)
- strip.set_pixel(pix[45],blank)
- strip.set_pixel(pix[114],blank)
- strip.set_pixel(pix[115],blank)
- strip.set_pixel(pix[30],blue)
- strip.set_pixel(pix[31],blue)
- strip.set_pixel(pix[100],blue)
- strip.set_pixel(pix[101],blue)
- strip.show()
- shifty = 1
- utime.sleep(random.randint(2, 5))
- blink()
- open_time = 0.001
- count += 1
- return
- #Main
- sidebar() #setup the bars on the side, they are static
- functions = [eq, stars, scanner, iloveDP, expanding_heart, eyes] #list of available functions to call on
- while True:
- wipe()
- random.choice(functions)() #infinite loop of calling on the various functions
Advertisement
Add Comment
Please, Sign In to add comment