void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
char output[6];
String imageFile = "1234567890";
int fbLen=imageFile.length();
Serial.println(imageFile);
for (int n=0; n<fbLen; n=n+5) {
if (n+5<fbLen) {
Serial.println("part");
strncpy(output, imageFile.c_str(), 5);
output[5] = 0;
}
else if (fbLen%5>0) {
Serial.println("end");
size_t remainder = fbLen%5;
strncpy(output, imageFile.c_str(), remainder);
output[5] = 0;
}
Serial.println(output);
}
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}