Dear All,
Happy New Year!
Need support on programming Mega 2560 for taking below action:
Input from RS232 Port data
Compare received data with 1st string & 2nd string as FIRE ALARM, if yes Print next 2 lines of data that is coming in RS232 port data, else ignore.
Interface GSM module to send SMS if above string compare is passed to predefined 5 mobile numbers
Please follow the advice on posting code given in posting code
In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless
suggest you capture each char from the serial interface into a complete line and consider using functions in the string library (not String) to determine if the received string contains the substrings you're interested in