# write a micropython script for internal pull up with push button
from machine import Pin
from time import sleep
led = Pin(2, Pin.OUT)
switch = Pin(0,Pin.IN,Pin.PULL_UP)
while True:
    x = switch.value()
    print(x)
    if x==0:
        led.on()
    else:
        led.off()
Loading
esp32-devkit-c-v4
btn1:1.l
btn1:2.l
btn1:1.r
btn1:2.r
led1:A
led1:C
r1:1
r1:2