During my first run I implemented, that each time I click the button a new line, containing the received data, is written into a text file. the value should increase by one. :
J1 35.000
J1 75.000
J1 125.000
J1 15.000
J1 30.000
J1 1.000
J1 1.000
J1 35.000
J1 75.000
J1 125.000
J1 15.000
J1 30.000
J1 1.000
J1 1.000
J1 2.000
J1 35.000
J1 75.000
J1 125.000
I then re-uploaded the sketch and got these results:
J1 1.000
J1 1.000
J1 2.000
J1 1.000
J1 2.000
J1 3.000
J1 1.000
J1 2.000
J1 3.000
J1 4.000
J1 1.000
J1 2.000
J1 3.000
J1 4.000
J1 5.000
During my third test set inData = "" (as you suggested). I clicked the button 20 times and by an increment of 1:
J1 1.000
J1 2.000
J1 3.000
J1 4.000
J1 5.000
J1 6.000
J1 7.000
J1 8.000
J1 9.000
J1 10.000
The empty lines are probably the "\r" I saw during debugging. Am I right?