I am trying to write String
to serial in arduino
,
The string has multiple data types :
String sendID=("alarmWithPointer:" + String(12,DEC) ) ;//AlarmOncePointer
and Serial.write(sendID)
gives error, so i tried :
void sendDataSerial(String data)
{
int len=data.length()+1;
char buf[len];
data.toCharArray(buf, len) ;
Serial.write(buf);
}
Which also gives random numbers in the serial .