Understanding of the program
Explanation and understanding of the code of example
The instructor should help for the explanation
IoT is mounted in a wooden model of Sheep and the example is named "Internet Sheep".
When someone touches her tail, she sends an e-mail to its owner. Accordingly, He can take control by going to the Sheep's Web page and can turn two buttons ON or OFF. When one of the buttons is turned ON, the sheep's eyes light up accordingly.
In this case, the IoT actuators are the two LEDs that we can control. In this simple example, diodes can be replaced by other, more complex actuators that have their own logic of operation.
The interesting thing in this example is that a WEB page is embedded in IoT. The device intercepts for a possible connection with a client and provides the processing of requests to change the status of two of the diodes.
The other important point is that IoT works in multitasking mode. One process handles the network, another monitors the information from the touch sensor. In this way, the two processes work in parallel and independently of each other.
ESP23 supports virtual and real multitasking modes.
Once the IoT connects to the network, you can access the device's WEB page (the IP address is displayed on the Serial monitor after a successful connection) and take control of the LEDs by turning them ON or OFF.