I have been asked to start a new thread here rather than on GITHUB
The above example has the following line
if (Serial.read() == '\n')
This does not work no matter which option for line termination is chosen at the bottom of the serial monitor.
The different options give:
No line ending sends NO char (as you would expect)
Newline sends 10 only (as you would expect)
Carriage return sends 13 only (as you would expect)
NL and CR sends 13 only (as you would NOT expect)
If you replace Serial.read() with char(Serial.read()) or int(Serial.read())
then Newline works.
HOWEVER the same statement DOES work in the Serial Event example.
There are two things that are different between the two instances
1 The if statement is in the serialEvent() function which does not seem a likely cause.
2 In the first program the test follows Serial.parseInt()
Can you mix the two forms of working?
Alan