Toggle Navigation
Hatchery
Eggs
kit2020
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
# based on Homescreen ledtronics rev. 17 (by maf) # thanks! import time import neopixel import _thread def leds_for_offset(offset): return [0x00, 0x00, 0x00] * offset + [0x00, 0x64, 0x00] + [0x00, 0x00, 0x00] * (12 - 1 - offset) def run(): offset = 4 delta = 1 while True: offset += delta neopixel.send(bytes(leds_for_offset(offset))) if offset == 1 or offset == 9: delta = -delta time.sleep_ms(200) else: time.sleep_ms(100) _thread.start_new_thread("LED", run, ())