from machine import Pin
from time import sleep
switch = Pin(0, Pin.IN)
while True:
if (switch == HIGH):
print("Switch is ON")
else:
print("Switch is in OFF")
Loading
pi-pico-w
pi-pico-w
from machine import Pin
from time import sleep
switch = Pin(0, Pin.IN)
while True:
if (switch == HIGH):
print("Switch is ON")
else:
print("Switch is in OFF")