from machine import Pin
from neopixel import NeoPixel
from time import *
# create NeoPixel driver on pin 13 for 2 pixels:
np = NeoPixel(Pin(13), 2)
print('set the first pixel to white..')
np[0] = (255, 255, 255)
print('set the second pixel to yellow..')
np[1] = (255, 255, 0)
# write data to all pixels:
np.write()
while True:
n = input('input pixel number (0 or 1): ')
red = input('input red color (0 - 255): ')
green = input('input green color (0 - 255): ')
blue = input('input green color (0 - 255): ')
# convert inputs to integer and set the pixel color:
np[int(n)] = (int(red), int(green), int(blue))
np.write()
sleep_ms(100)