from machine import Pin
from utime import sleep
led = Pin(13,Pin.OUT)
button = Pin(14,Pin.IN)
while True:
if button.value() == 1:
led.value(1)
print("LED is on")
sleep(0.3)
elif button.value() == 0:
led.value(0)
sleep(0.3)
# switch - a device for making, breaking, or changing the connections in an electrical circuit
# Types of switch :--
# SPST (Single Pole Single throw)
# SPDT (single pole double throw)
# DPST (double pole, single throw)
# DPDT (double pole double throw)
# push button - A push button is a simple switch mechanism that controls a machine or process.