In this recipe, we will add the final touch to our internet-connected weather machine. We will take the bulk of code introduced in the recipes throughout this chapter and add an event loop to our main function so that we can react to button press events by displaying the weather of random cities around the world. This recipe will provide you with a good example of how you can add an event loop to an existing code base to create user interactivity.
Creating an IoT button to show the weather around the world
Getting ready
You will need access to the REPL on the ESP8266 to run the code presented in this recipe.