def tm(): m = rf.Master(testbox_config) send_msg = FromMaster() while True: result = m.exchange(send_msg) if result is not None: print(result.i0) else: print('Timeout') send_msg.i0 += 1 pyb.delay(1000)
def test_master(): m = radio_fast.Master(master_config) send_msg = FromMaster() while True: result = m.exchange(send_msg) if result is not None: print(result.i0) print("Just my $0.02 worth") else: print('Timeout') send_msg.i0 += 1 pyb.delay(1000)
def master(lcd): yield Roundrobin() m = rf.Master(testbox_config) send_msg = FromMaster() while True: start = pyb.millis() result = m.exchange(send_msg) t = pyb.elapsed_millis(start) lcd[1] = 't = {}mS'.format(t) if result is not None: lcd[0] = str(result.i0) else: lcd[0] = 'Timeout' yield from wait(1.0) send_msg.i0 += 1
async def run_master(lcd): await asyncio.sleep(0) m = rf.Master(testbox_config) send_msg = FromMaster() while True: start = ticks_ms() result = m.exchange(send_msg) t = ticks_diff(ticks_ms(), start) lcd[1] = 't = {}mS'.format(t) if result is not None: lcd[0] = str(result.i0) else: lcd[0] = 'Timeout' await asyncio.sleep(1) send_msg.i0 += 1