Code: Select all
200804-9883d8e.hex
Code: Select all
import time, bluetooth
bt = bluetooth.BLE()
then = time.ticks_ms();
_IRQ_SCAN_RESULT = const(1 << 4)
def irq(event,adv):
if event == _IRQ_SCAN_RESULT:
print('@mins:',round(time.ticks_diff(time.ticks_ms(),then)/1000/60,2),adv[1])
bt.irq(handler=irq)
bt.active(True)
## scan forever
bt.gap_scan(0,10000, 10000)