from machine import Pin
import utime
# Define the GPIO pins for the push button and slide switch
button_pin = Pin(18, Pin.IN, Pin.PULL_UP) # Pin 18 for the push button with pull-up resistor
switch_pin = Pin(15,Pin.IN) # Pin 15 for the slide switch
while True:
# Check the state of the push button
print("Push_button:")
print(button_pin.value())
# Check the state of the slide switch
print("Slide_Switch:")
print(switch_pin.value())
# Delay for a short duration to avoid continuous printing
utime.sleep(0.5)