Skip to content

Instantly share code, notes, and snippets.

@dewomser
Created December 27, 2023 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dewomser/0d0b32d880582f841473cfcc050c9095 to your computer and use it in GitHub Desktop.
Save dewomser/0d0b32d880582f841473cfcc050c9095 to your computer and use it in GitHub Desktop.
Multimeter von Parkside Lidl und die serielle Schnittstelle
import serial
# Modify the port name to match your serial port
port = serial.Serial('/dev/ttyUSB0', 2400, timeout=1, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE)
# Read data from the serial port
while True:
# Read 2-byte preamble
preamble = port.read(2)
# Check if the preamble is correct
if preamble == b'\xdc\xba':
# Read the 6th byte
data = port.read(10)
sixth_byte = data[5]
# Print the 6th byte
print(f"The 6th byte is {sixth_byte}")
@dewomser
Copy link
Author

Ist ein einfaches Beispiel . Dieses Script funktioniert nur mit dem Durchgangsprüfer. Werte 0 und 255 .
Bing-Chat hat dabei geholfen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment