from machine import Pin
import time
from utime import sleep
slide_pin=Pin(15,Pin.IN,Pin.PULL_DOWN)
led_pin=Pin(5,Pin.OUT)
print("Slide Switch Started!")
while True:
if slide_pin.value()==0:
led_pin.value(1)
print("Switch is ON")
else:
led_pin.value(0)
print("Switch is Off")
time.sleep(0.1)