Working with strings and functions

It is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. Just use cstrings - char arrays terminated with 0.

To be honest, if that was my project I would create a global char array to hold the message and then it would be directly accessible from the function.

...R