Hello,
in my current project I have follwing problem.
I want to transmit a string argument to a function from my main loop.
The project contains at the moment about 2500 codeline and i have only 358 bytes free memory ( freeMemory () )
When I did the coding like the code here,the arduino will restart ( again and again ) after loading the new sketch. I think I must have a memory problem maybe with useing the mySoftSerial.print ( in my case Scada.print) function, because I think it is good to use a pointer to my char array ( string )
Or what are you thinking where the bug is located ??
The SendToScada("...") function is called some times in my code
void loop()
{
//do some other work here
sendToScada("this text should be send to a scada system");
}
void sendToScada(char* sMessageToSend)
{
Scada.listen();
Scada.print("V"); // Messageheader
for(int i=0;i<strlen(sMessageToSend);i++)
Scada.print(sMessageToSend[i]);
Scada.print("\n");
XBee.listen(); //set to other serial active
}