# Project objective: Light up an external LED when a push button is pressed
#
# Hardware and connections used:
#   Push button to GPIO Pin 16
#   10000 ohm pull-down resistor for the push button
#   LED to GPIO Pin 15
#   220 ohm resistor for LED
# 
# Programmer: Adrian Josele G. Quional

# modules
from machine import Pin
from time import sleep
import time
from neopixel import Neopixel
 
numpix = 6
pixels = Neopixel(numpix, 0, 18, "GRB")
LED = Pin(15, Pin.OUT)      # creating LED object, setting it as OUT
BUTTON = Pin(16, Pin.IN)    # creating Push Button object, setting it as IN
 
yellow = (255, 100, 0)
orange = (255, 50, 0)
green = (0, 255, 0)
blue = (0, 0, 255)
red = (255, 0, 0)
color0 = red
 
pixels.brightness(100)
pixels.fill(green)
pixels.set_pixel_line_gradient(1, 3, green, blue)
pixels.set_pixel_line(4, 5, red)
pixels.set_pixel(5, (255, 255, 255))
 
while True:
    #if color0 == red:
     #  color0 = yellow
      # color1 = red
    #else:
     #   color0 = red
      #  color1 = yellow
    #pixels.set_pixel(0, color0)
    #pixels.set_pixel(1, color1)
    pixels.set_pixel_line(2, 5, blue)
    pixels.set_pixel_line_gradient(1, 3, green, blue)
    pixels.show()
    time.sleep(2)
    pixels.set_pixel_line(2, 5, blue)
    pixels.show()

'''
# if the signal from the button is HIGH (button is pressed), turn LED on
    if BUTTON.value() == 1:
        LED.on()
        sleep(0.1)

    # otherwise, turn the LED off
    else:
        LED.off()
'''
$abcdeabcde151015202530fghijfghij
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT