// écrire des ligne de 20 caracteres maxi
void PrintScroll(String m) {
if (m.indexOf("<a ") >= 0 && m.indexOf(">") > m.indexOf("<a ") && m.indexOf("</a>") > m.indexOf(">")) { // on a un hyperlien inexploitable hors navigateur
while (m.indexOf("<a ") >= 0) {
int d = m.indexOf("<a "); // pointe sur < ouvrant
int f = m.indexOf(">", m.indexOf("<a ")); // pointe sur > fermant
f++;
String s = m.substring(0, d) + m.substring(f);
s.replace("</a>", "");
m = s;
}
}
if (m.indexOf("ception heure") > 0) m = "Reception heure NTP"; // abrege le message pour tenir dans les 20 caracteres d'une ligne
for (int i = 0; i< m.length(); i++) {
if (i!= 0 && (i) % 20 == 0) Serial.println("*"); // passe a la ligne
Serial.print(m[i]);
}
if (m.length() % 20 != 0) for (int i = m.length() % 20; i < 20; i++) Serial.print(" "); // bourrage fin de ligne avec espaces pour effacer contenu précedent sans passer sur le ligne suivante
Serial.println("*");
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
PrintScroll("1234567890123456789012345678901234567890");
PrintScroll("12345678901234567890");
PrintScroll("123");
PrintScroll("123");
PrintScroll("ABCDEFGHIJKLMOPQR");
PrintScroll("IP WIFI : 192.192.192.192");
PrintScroll("123");
PrintScroll("ABCDEFGHIJKLM123");
PrintScroll("IP ETH : 192.192.192.192");
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}