from machine import pin
import time
gsw = pin(28,pin.IN)
bsw = pin(27,pin.IN,pin.PULL_UP)
gled = pin(3,pin.OUT)
bled = pin(4,pin.OUT)
while True:
gsw_val = gsw.value()
print ('Green button state = ',gsw_val)
time.sleep_ms(200)
if gsw_val == 0:
gled.value(1)
else:
gled.value(0)