from machine import Pin,mem32
import time
p_start=Pin(14,Pin.IN,Pin.PULL_DOWN)
p_stop=Pin(15,Pin.IN,Pin.PULL_DOWN)
out=Pin(25,Pin.OUT)
stato_pin=machine.mem32[0xd0000000+0x004]
while True:
if p_start.value():
time.sleep_ms(20)
if p_start.value():
out.on()
if p_stop.value():
time.sleep_ms(20)
if p_stop.value():
out.off()
if stato_pin != machine.mem32[0xd0000000+0x004]:
stato_pin = machine.mem32[0xd0000000+0x004]
print(bin(stato_pin), time.ticks_ms())