Code:
if (serial.available() > 0): data = serial.readString() # read available data as string print(data) return dataIf some data has arrived, but not all, you will only read what has arrived, not what hasn't.
You need to keep reading data until you know you have complete data. That involves considering some data may have not yet arrived but will, some time in the future.
Code:
serial.writeString("d") #send command "d" to request data from Arduino if (serial.available() > 0):Doing it properly isn't straight forward. I will see if I can find any useful examples I have.
Statistics: Posted by hippy — Fri Jul 04, 2025 3:25 pm