from machine import Pin
import time

switch_pin = Pin(0, Pin.IN)

while True:

    switch_state = switch_pin.value()

    if switch_state == 0:
        print("on")
    else:
        print("off")

    time.sleep(0.1)
#pinout D3
6e7fb09b604ac822eb21a3794c498398f03a77d1
<mask token>

<mask token>
while True:
    switch_state = switch_pin.value()
    if switch_state == 0:
        print('on')
    else:
        print('off')
    time.sleep(0.1)

<mask token>
switch_pin = Pin(0, Pin.IN)
while True:
    switch_state = switch_pin.value()
    if switch_state == 0:
        print('on')
    else:
        print('off')
    time.sleep(0.1)

from machine import Pin
import time
switch_pin = Pin(0, Pin.IN)
while True:
    switch_state = switch_pin.value()
    if switch_state == 0:
        print('on')
    else:
        print('off')
    time.sleep(0.1)

from machine import Pin
import time

switch_pin = Pin(0, Pin.IN)

while True:

    switch_state = switch_pin.value()

    if switch_state == 0:
        print("on")
    else:
        print("off")

    time.sleep(0.1)
#pinout D3