from machine import Pin
import neopixel
import time
LED_PIN = 5
LED_COUNT = 16
SPEED = 0.001
OFFSET = LED_COUNT // 2
np = neopixel.NeoPixel(Pin(LED_PIN), LED_COUNT)
# <<< CHANGE THIS TO SET BACKGROUND COLOR >>>
BACKGROUND = (180,120, 30) # Example: blue (R,G,B)
# --------------------------------------------
pos = 0
while True:
# Set all LEDs to the background color
for i in range(LED_COUNT):
np[i] = BACKGROUND
# Two rotating white LEDs
led1 = pos % LED_COUNT
led2 = (pos + OFFSET) % LED_COUNT
np[led1] = (255, 255, 255) # bright white
np[led2] = (255, 255, 255)
np.write()
pos = (pos + 1) % LED_COUNT
time.sleep(SPEED)