Python Forum
[PyQt] Sending 4 bytes Hex data over serial in PyQt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Sending 4 bytes Hex data over serial in PyQt
#2
First of all, you need bytestrings.
You can put everything into one bytestring or a bytearray:
my_bytestring1 = b'abdx' # bytestring
But you can also work with integers in different representation:
my_bytestring2 = bytes([97, 98, 100, 120])
my_bytestring3 = bytes([0x61, 0x62, 0x64, 0x78])
Then you can send the bytestring via serial.write(my_bytestring1)
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: Sending 4 bytes Hex data over serial in PyQt - by DeaD_EyE - Oct-28-2019, 02:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Serial Port data readout macellan85 3 8,028 Jun-19-2020, 12:32 PM
Last Post: deanhystad
  Read Data from Serial port PA3040 2 3,055 Feb-25-2020, 04:13 PM
Last Post: Denni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020