User manual

return esp8266.readString();
}
2
Troubleshooting
There will often be errors and complication when developing programs. To have
any chance at all at finding them, there are two debug-functions that are activated
or deactivated via a parameter at the very beginning of the program.
#define DEBUG true
The first function does nothing but provide a simplified output of text via the serial
interface defined as standard. When the constant DEBUG is true, the content of
the string Msg will be sent.
void debug(String Msg)
{
if (DEBUG)
{
Serial.println(Msg);
}
}
The second function is also explained quickly. When the function
serialDebug is called, the program will switch to a permanent loop and will from
then onwards behave like the first tested SoftwareSerial-program. This means that
all data that are sent to the controller via the serial monitor will be passed on di-
rectly to the module and vice versa. In case of error, you can therefore call the
function and send manual commands to see where the error is located.
//---Debug Functions---
void serialDebug() {
while (true)
{
if (esp8266.available())