from machine import Pin
import bluetooth
from BLE import BLEUART
#init BLUEART
print("iniciando")
name = 'ESP32'
ble = bluetooth.BLE()
uart = BLEUART(ble,name)
print(uart)
def on_rx():
rx_buffer = uart.read().decode().strip()
wart.writ('ESP32 says: ' + rx_buffer + '\n')
#Registrar evento de bluetooth
wart.irq(handler=on_rx)