A cloud-controlled digital candle
In the previous recipe, we learned how to build a digital candle using Arduino. But what about the IoT aspect of the project? Well, this is what we are going to deal with in this recipe. We are going to connect the project from the previous recipe to the cloud, and learn how to control it from anywhere. This could, for example, be a candle that you send to loved ones that are far away, and that you suddenly switch on to show you are thinking about them.
Getting ready
For this project, first you need to follow the previous recipe to build the candle. Then, you can configure the candle with some new code to control it from the cloud.
You will need to install the PubSubClient
and aREST
libraries, which you can easily do by using the Arduino library manager.
The sketch starts as always with the required libraries:
#include <SPI.h> #include <WiFi101.h> #include <PubSubClient.h> #include <aREST.h> #include <Adafruit_NeoPixel.h> #define...