User manual
004
return esp8266.readString();
005
}
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.
001
void debug(String Msg)
002
{
003
if (DEBUG)
004
{
005
Serial.println(Msg);
006
}
007
}
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.
001
//---Debug Functions---
002
void serialDebug() {
003
while (true)
004
{
005
if (esp8266.available())