import bluetooth
import time
import _thread as thread
def ble_thread():
ble = bluetooth.BLE()
ble.irq(lambda *args: print("Ok"))
print("Bluetooth is active")
ble.active(True)
if __name__ == "__main__":
print("Initialize threading...")
thread.start_new_thread(ble_thread, ())
while True:
print("Main thread")
time.sleep_ms(5)