Code: Alles auswählen
import serial
ser = serial.Serial('COM2', 9600, timeout=1)
such = bytes([0])
ohne = 0
while 1:
coiner = ser.readline()
zahl = coiner.count(such)
if zahl != ohne:
print (zahl)Code: Alles auswählen
import serial
ser = serial.Serial('COM2', 9600, timeout=1)
such = bytes([0])
ohne = 0
while 1:
coiner = ser.readline()
zahl = coiner.count(such)
if zahl != ohne:
print (zahl)