from machine import Pin
import time
# Define GPIO pins
switch_pin = Pin(14, Pin.IN,Pin.PULL_DOWN)
# Main loop
while True:
# Read the state of the switch
switch_state = switch_pin.value()
print(switch_state)
from machine import Pin
import time
# Define GPIO pins
switch_pin = Pin(14, Pin.IN,Pin.PULL_DOWN)
# Main loop
while True:
# Read the state of the switch
switch_state = switch_pin.value()
print(switch_state)