Water Wuality Monitoring

Hey please im trying to build a water quality monitoring system. when i use the function send_sms();
i get the error 'send_sms' was not declared in this scope.
Im using an arduino Mega clone and sim900. can anyone tell me please why i get this error. Please

Apart from not seeing why your text wasn’t sent..*
I’d make the following suggestions…
Ask someone to help restructure and rewrite all your code.
Your use of delays anywhere is perplexing, along with repeated blocks of code and a glaring lack of understanding how or why you’ve use some pieces of code.

I know this is harsh, but when you repost your new code WITH CODE TAGS and proper indentation, it will become clearer to both of us.

*- I’ve written a lot of code, and while yours is decent for someone learning and experimenting, it’s nowhere good enough for an application to be used in earnest.

I would suggest your make a copy of your code and remove ALL code not related to SMS or find an example code for SMS.
Then trouble shoot it as a standalone. Once you get it to work combine it with your remaining functional code.

BTW If you haven't already, I would recommend you do the same thing with each device you are using. It will become much easier to troubleshoot.

Please edit your post to add code tags.

i get the error 'send_sms' was not declared in this scope.

How did you get to such a large program, with such a basic, fundamental mistake?

The library was not properly included, or wrong library. Make sure you completely understand how the basic SMS examples work before creating a new program, and proceed to add features one step at a time, testing as you go.