from machine import Pin
from time import sleep
swtch_1 = Pin(4,Pin.IN,Pin.PULL_DOWN)
swtch_2 = Pin(5,Pin.IN,Pin.PULL_DOWN)
swtch_3 = Pin(6,Pin.IN,Pin.PULL_DOWN)
led_sw1 = Pin(1,Pin.OUT)
led_sw2 = Pin(2,Pin.OUT)
led_sw3 = Pin(3,Pin.OUT)
while True:
if swtch_1.value() == 1:
led_sw1.value(1)
sleep(1)
led_sw1.value(0)
sleep(1)
print("Ok _ sw1")
if swtch_2.value() == 1:
led_sw2.value(1)
sleep(1)
led_sw2
if swtch_2.value() == 1:
led_sw2.value(1)
sleep(1)
led_sw2.value(0)
sleep(1)
print("OK sw2")
if swtch_3.value() == 1:
led_sw3.value(1)
sleep(1)
led_sw3.value(0)
sleep(1)
print("end of nested loop")