import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
from machine import Pin
from neopixel import NeoPixel
pin = Pin(26, Pin.OUT) # set GPIO0 to output to drive NeoPixels
pin2 = Pin(19, Pin.OUT) # set GPIO0 to output to drive NeoPixels
np = NeoPixel(pin, 2) # create NeoPixel driver on GPIO0 for 2 pixels
np2 = NeoPixel(pin2, 8) # create NeoPixel driver on GPIO0 for 8 pixels
while 1:
np[0] = (255, 0, 255) # set the first pixel to white
np[1] = (255, 255, 0) # set the first pixel to white
for i in range(8):
np2[i]=(255,0,255)
np.write() # write data to all pixels
np2.write() # write data to all pixels
time.sleep(0.3)
np[0] = (0, 0, 0) # set the first pixel to white
np[1] = (0, 0, 0) # set the first pixel to white
for i in range(8):
np2[i]=(0,0,0)
np.write() # write data to all pixels
np2.write() # write data to all pixels
time.sleep(0.3)