from machine import Pin
import time
button=Pin(15, Pin.IN, Pin.PULL_UP)
led=Pin(2, Pin.OUT)
while True:
if button.value():
led.off()
print('lampu mati')
else:
led.on()
print('lampu menyala')
time.sleep(0.1)