Weird Enter Key Behavior

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 ....

There is no way on earth anyone can guess where your problem is without seeing the code. Please post your entire sketch, in code tags per the forum protocol. Please read the sticky threads at the top of the forum.

Hi,
Third Paragraph....code works fine using different PC......
This is not a code issue. its a Laptop / IDE issue.

It used to work fine on the laptop in DEC, something has changed in either IDE or Win10 or a setting in the laptop.....
I am looking for support or anyone who may have had a similar issue to give me some PC pointers...

But thanks for your reply.

The problem is likely the line ending setting in the menu at the bottom right side of the Serial Monitor window. The menu has four options: "No line ending", "Newline", "Carriage Return", "Both NL & CR". If your code was written to work with no line ending, or a single line ending, using a setting that sends an extra line ending will result in the symptoms you describe. You can check which setting is being used on your desktop computer, then switch to that same setting on the laptop.

You are a Legend Pert.

Thanks you nailed it in one... Desktop set to "No line Ending" Laptop set to "New Line"

I hadn't even noticed this setting.
Adjusted Laptop to match desktop and they both work fine....

Thanks again, I new it had to be something simple.....

You're welcome. I'm glad to hear it's working now. Enjoy!
Per