def initRxMode(self, callback=None): self._write(b'AT+TEST=RXLRPKT\r\n') self._waitTimeout(200) self.uart.read() self._timer = timEx.addTimer(20, timEx.PERIODIC, self._monitor) if callback: self.callback = callback
def __init__(self, addr=0x08): self.i2c = i2c_bus.get(i2c_bus.M_BUS) self.addr = addr self._available() self.press_status = 0x00 self.release_status = 0x00 self._timer = timEx.addTimer(100, timEx.PERIODIC, self._monitor) self.status_hold = 0xff
def __init__(self, port): self.uart_data = '' self.gps_time = '00:00:00' self.gps_pos_state = '' self.latitude = '' self.longitude = '' self.satellite_num = '' self.uart = machine.UART(1, tx=port[0], rx=port[1]) self.uart.init(9600, bits=0, parity=None, stop=1) self._timer = timEx.addTimer(100, timEx.PERIODIC, self._monitor)
def __init__(self): self.uart = machine.UART(1, tx=17, rx=16) self.uart.init(19600, bits=0, parity=None, stop=1) self._timer = timEx.addTimer(100, timEx.PERIODIC, self._monitor) self._times = 0 self.cb = None self.unknownCb = None self.access_add = 0 self.user_id_add = 0 self.state = '' time.sleep_ms(100) self.readUser()
def __init__(self): self.uart = machine.UART(1, tx=17, rx=16) self.uart.init(9600, bits=8, parity=None, stop=1) self._timer = timEx.addTimer(200, timEx.PERIODIC, self._monitor) self.data_save = b''