String hexString;
char str[20000];
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
int pp;
String dateora="80658269788469";
String r ="";
r+=char(dateora.substring(0, 2).toInt());
r+=char(dateora.substring(2, 4).toInt());
r+=char(dateora.substring(4, 6).toInt());
r+=char(dateora.substring(6, 8).toInt());
r+=char(dateora.substring(8, 10).toInt());
r+=char(dateora.substring(10, 12).toInt());
r+=char(dateora.substring(12, 14).toInt());
Serial.println(r);
dateora="04032023105000";
r ="";
r+=inttohex(dateora.substring(0, 2).toInt(),2);
r+=inttohex(dateora.substring(2, 4).toInt(),2);
r+=inttohex(dateora.substring(4, 6).toInt(),2);
r+=inttohex(dateora.substring(6, 8).toInt(),2);
r+=inttohex(dateora.substring(8, 10).toInt(),2);
r+=inttohex(dateora.substring(10, 12).toInt(),2);
r+=inttohex(dateora.substring(12, 14).toInt(),2);
Serial.println(r);
memset(str,0,20000);
//sprintf(str,"66");
Serial.println(str);
sprintf(str+strlen(str),"%s",inttohex(5055,4));
Serial.println(str);
Serial.println(inttohex(5055,4));
}
String inttohex(int decValue, byte desiredStringLength) {
hexString = String(decValue, HEX);
while (hexString.length() < desiredStringLength) hexString = "0" + hexString;
return hexString;
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}