python Actual Serial Assistant_Solve 8 Serial Port Multiple Send Problem

  • 2021-06-28 13:07:27
  • OfStack

Tonight finally solved the serial port send problem, change the code as follows:


def write(self, data):
    if self.alive:
      if self.serSer.isOpen():
        self.serSer.write(data)


def m_send1butOnButtonClick( self, event ):
    if self.ser.alive:
      send_data = ''

      send_data += str(self.m_textCtrl5.GetValue())
      self.ser.write(send_data)

I tried it, as long as it was sent with the write() function, no matter how much it was sent, but hexadecimal sending is currently unresolved


Related articles: