Hi I have a sketch that allows my Nano to interact with PCA 16 servo Card over I2C. I use it on a model train layout to operate turnout (points) to change tracks, via Loco net commands.
I have a serial monitor portion of the sketch, that if serial >0 then use the values and do stuff.
So basically I run the sketch, plug in the laptop, and set my turn outs "Limits" using serial. I then write them to EEprom so next time the layout is powered up the Ardino recovers the settings and all is well.
The sketch works flawlessly and has done for some time now (6 months)
Recently some time in 2020, The serial monitor seems to record the input value ok, and the when I hit enter it reads the serial twice. the first time is the previously entered value the second time as there is nothing its is 0, as such the servo tries to drive to the 0 deg position.
Today I got frustrated and took the code and a Nano to my desktop. It DOES NOT happen on the desktop. sketch works fine. Serial entry is exactly as expected. so I changed the Nano in the train room, expecting it might be that. Same issue laptop records zeros.
So I take the old Nano to the desktop works fine. So I set the limits using the desktop PC and installed the nano and all is good.
I took the spare nano back to the laptop, again zeros. I plugged in A USB key board same issue using the external key board.
I have some "Screen prints" in my sketch, and I can see it accepts the first input with the correct values, but then immediately runs that bit of code again (only on the laptop) and the second time picks up 0 as the values as nothing has been entered in the serial window.
My laptop is an I7 dell 2016 inspiron W10 with latest Patches, with a number pad on the right and a normal laptop keyboard.
I tried IDE 1.8.10, 1.8.12, and an older 1.8.3 on the laptop all outcomes the same. Both enter keys have the exact same outcome. Yet I am typing this email with said laptop and Enter is not producing two new lines etc....
the dektop is same spec, but running IDE 1.8.3 works perfectly....the issue is the laptop or windows 10 or both....
Any hints on where to start looking ....