Hi there, I hope I'm in the right category. My first post here, so please mods move this if I'm not in the right spot!
Firstly I realize the scope of this may go beyond Arduino itself, but I figured maybe someone here can help. I'm testing some really basic code to send simple sensor data from the Arduino (Uno, Nano) to a Raspberry Pi via USB and using Pyserial (Python3) and in the example here everything ultimately works fine except when the Analog sensor is being read on the other end. In other words, it will Serial.print() just perfect in the IDE, but if I attempt to read from within Python, the sensor value is randomly switching from the correct numbers to totally random numbers.
I hope this screenshot contains everything to explain what I'm attempting here, and the outputs. What's perplexing me is that it's getting the data MOST of the time, but every few prints on the Python side it's not correct. I've tried changing delays etc. but that makes no difference in the integrity. If I for example change that sensor data to a static number of any type, the output is consistent. I hope this is the right place to ask for help I'm running out of ideas here!