User manual

debug("Wrong UDP Command");
if (sendCom("AT+CIPSEND=19", ">"))
{
sendCom("Wrong UDP Command", "OK");
}
}
}
}
}
The inbound commands are analysed in the loop-routine, which is continually
gone through. Once data from the module arrived (esp8266.available()), they are
analysed for the presence of the characters »+IPD,«. If the command led is also
found, the command parseInt() automatically saves the next number in the vari-
ables setLed. According to our definition of the commands, this should either be 1
or 0 and therefore switch the LED high or low. Next, the debug-function and the
CIPSEND-command transmit a confirmation to the computer. If the command led
was not part of the data received by the module, an error message will inform of a
defective command. The first control via the network would now be complete.
2.4 | Network switch
The previous program assessed the first commands via the controller and
switched an LED accordingly.
The next program maintains this function but can also additionally send a com-
mand into the network independently. Connect a
button to the controller as shown in the setup
image.
Required parts
1 x pinboard, 1 x NanoESP, 1 x LED (red), 1 x button, 1 x
resistor 1 kOhm (brown-black-red), circuit wire