This commit is contained in:
david rice
2026-02-18 14:29:30 +00:00
parent 768b7a21d0
commit 611a4000fd

View File

@@ -82,14 +82,9 @@ def trigger_serial_command():
# Serial logic # Serial logic
print(f"[{time.strftime('%H:%M:%S')}] SENDING SERIAL COMMAND...") print(f"[{time.strftime('%H:%M:%S')}] SENDING SERIAL COMMAND...")
command = 83 # 0x53 'S' ASCII command = 115 # 0x73 's' ASCII
b1 = (voltage_mv >> 24) & 0xFF # Most Significant Byte data = (command, state)
b2 = (voltage_mv >> 16) & 0xFF
b3 = (voltage_mv >> 8) & 0xFF
b4 = voltage_mv & 0xFF
data = (command, state, b1, b2, b3, b4)
byte_data = pack_integers_to_bytes(*data) byte_data = pack_integers_to_bytes(*data)
ser.write(serial.to_bytes(byte_data)) ser.write(serial.to_bytes(byte_data))