20 lines
348 B
Python
20 lines
348 B
Python
|
from machine import Pin, UART
|
||
|
from time import sleep_ms
|
||
|
import os
|
||
|
|
||
|
|
||
|
def button_irq(pin):
|
||
|
|
||
|
print("pressed")
|
||
|
|
||
|
|
||
|
#button = Pin(5, Pin.IN, Pin.PULL_UP)
|
||
|
#button.irq(trigger=Pin.IRQ_FALLING, handler=button_irq)
|
||
|
|
||
|
os.dupterm(None, 1)
|
||
|
uart = UART(0, baudrate=9600)
|
||
|
|
||
|
while True:
|
||
|
if uart.any():
|
||
|
u = uart.read()
|
||
|
uart.write(u)
|