// SafeString_Example1c.ino // install the SafeString library from the Arduino Library manager or // download and install the SafeString zip file from // www.forward.com.au/pfod/ArduinoProgramming/SafeString/index.html #include "SafeString.h" createSafeString(msgStr, 10, "A0"); // increased to capacity of 10 and initialize with A0 text void setup() { // Open serial communications and wait a few seconds Serial.begin(9600); for (int i = 10; i > 0; i--) { Serial.print(' '); Serial.print(i); delay(500); } Serial.println(); SafeString::setOutput(Serial); // enable error messages and debug() output to be sent to Serial if (SafeString::errorDetected()) { while (1) { Serial.println(F("Error is SafeString globals!!")); delay(3000); } } } void loop() { Serial.println(msgStr.concat(" = ").concat(analogRead(A0))); // output the result while (1) { // stop here delay(1); // add delay(1) to prevent ESP32 reboots } }