L
With a LoPy updated to 0.9.1.b1 (the only one to succeed of four attempted so far), the GPIO (including IRQs) work better. This sample uses an interrupt to make the LED toggle:
import machine
led=machine.Pin("G16",machine.Pin.OUT)
button=machine.Pin("G17",machine.Pin.IN, pull=machine.Pin.PULL_UP)
def handler(button):
led.toggle()
irq=button.irq(trigger=button.IRQ_FALLING, handler=handler)
Note that the button itself will bounce, so this won't reliably toggle just once per press.