Hi, I want to create kindof a shell in my Arduino. For this reason, I need to read the entire line that comes in (the line will contain a command and parameters).
Think of the Cisco IOS interface. That's kindof what I want to do.
I have noticed that the Serial.available() call returns the number of characters in the buffer. But it reads the buffer just in a way as characters come in. So that's not very reliable. Obviously I need to read the buffer until ther's a newline and then I need to react.
For this purpose I need to collect the incoming characters across many loop iterations. But I don't know how to store values outside of the loop without re-allocating the variables again and again.
My questions:
a) Is there a method to grab the entire input line?
b) How can I store incoming strings outside the loop function?
It's a little confusing to see that you cannot really catch the newline in the Arduino serial interface, but it works when you use minicom.
Greetings
Markus