# 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
counter = 0
BUTTON2 = Pin(16, Pin.IN)
BUTTON3 = Pin(17, Pin.IN)
# continuously read the signal from the push button while the board has power
while True:
# if the signal from the button is HIGH (button is pressed), turn LED on
if BUTTON2.value() == 2:
counter += 1
print(counter)
if BUTTON3.value() == 3:
counter += 1
print(counter)
# LED.on()
# sleep(0.1)
# otherwise, turn the LED off
# else:
# LED.off()