Advertisement
cmass

크리스마스트리_UP

Nov 18th, 2019
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. from microbit import *
  2. import neopixel
  3. np = neopixel.NeoPixel(pin0, 24)
  4.  
  5. red = (255, 0, 0)
  6. orange = (219, 104, 24)
  7. yellow = (241, 212, 36)
  8. green = (0, 255, 0)
  9. blue = (0, 0, 255)
  10. navy = (0, 0, 139)
  11. purple = (76, 39, 55)
  12. white = (255, 255, 255)
  13.  
  14. color = [red, orange, yellow, green, blue, navy, purple, white]
  15. while True:
  16.     light = display.read_light_level()
  17.     display.scroll(light)
  18.     np.clear()
  19.  
  20.     n = 0
  21.     for a in range(light/35):
  22.         for b in range(3):
  23.             np[n] = color[a]
  24.             n = n + 1
  25.     np.show()
  26.     sleep(100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement