How to if(newSerialString) resetFunction and then run newSerialString

Right now, I have if-statements set-up with if (Serial.available() > 0) resetFunction();

Instead of calling the resetFunction whenever data is entered into the serial monitor, I want it changed so if a new string is received, then it will call the resetFunction.

However, data is received serially. So the incoming new string replaces the old string. I don't know how to store the old string. How would you store the old string?

In the absence of your code, my best suggestion is strcpy

I used strcpy, and some other things, and now it works.

Check out my tutorial Text I/O for the Real World, which has simple code to implement handling user commands from the Serial

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.