# # Project objective: To test a passive buzzer to play an alarm sound at one second interval
# #
# # Hardware and connections used:
# # Passive buzzer GND to Raspberry Pi Pico GND
# # Passive buzzer + Pin to GPIO Pin 15
# #
# # Programmer: Adrian Josele G. Quional
# # if passive buzzer is used, import the Speaker class from picozero
# from picozero import LED,Button
# from time import sleep
# # creating a Speaker object
# button = Button(2)
# led = LED(17)
# # continuously beep at 1 sec interval while the board has power
# # note: a passive buzzer can also be used to play different tones
# while True:
# button.wait_for
# sleep(1)
from machine import Pin
from time import sleep
led = Pin(17, Pin.OUT) # 14 number in is Output
push_button = Pin(2, Pin.IN) # 13 number pin is input
while True:
logic_state = push_button.value()
if logic_state == True: # if push_button pressed
print("True")
led.value(1) # led will turn ON
else:
print("False") # if push_button not pressed
led.value(0)