не прошло и пары лет, но я сделал ))
def decode_display(hex_str):
bytes_list = hex_str.split()
display = []
for row in range(32):
start = row * 4
end = start + 4
four_bytes = bytes_list[start:end]
# Convert 4 bytes to a 32-bit binary string
binary_str = ''.join(f'{int(byte, 16):08b}' for byte in four_bytes)
# Split into two 16-bit halves, swap, and reverse
swapped = binary_str[16:] + binary_str[:16]
mirrored = swapped[::-1]
# Replace bits with 'x' and ' '
display_row = mirrored.replace('1', 'x').replace('0', ' ')
display.append(display_row)
return display
hex_command = "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 1C 07 20 0C 22 08 B0 4A 20 08 28 09 20 08 24 08 98 06 22 0F 84 01 3E 48 02 00 A0 08 3E 0F A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7C 00 00 10 82 02 01 B1 29 28 99 51 29 A8 A5 11 29 6C A5 11 29 AA A5 11 29 29 99 00 82 00 00 00 7C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
display = decode_display(hex_command)
for row in display:
print(row)