I am trying use a HMI display. If I want to send a data, for example I want to write "TOPWAY" to 0x00000080 address it should like that:
Serial.write(0xaa); // packet head
Serial.write(0x42); // VP_N16 string write command
Serial.write(0x00); // VP_N16 address
Serial.write(0x00);
Serial.write(0x00);
Serial.write(0x80);
Serial.write(0x54); //T
Serial.write(0x4f); //O
Serial.write(0x50); //P
Serial.write(0x57); //W
Serial.write(0x41); //A
Serial.write(0x59); //Y
Serial.write(0x00); //string end with "\0"
Serial.write(0xcc); // packet tail
Serial.write(0x33); // packet tail
Serial.write(0xc3); // packet tail
Serial.write(0x3c); // packet tail
I want to make a method like SendString(String abc) to send that like above. I need convert string a hex array and call in Serial.write(array[i]). Can you hep me?