Controlling your robot from anywhere
To end this chapter and this book, we are going to integrate our mobile robot into the Internet of Things, and learn how to control it from anywhere in the world. We'll learn how to call the function we defined earlier from anywhere in the world, and then how to control the robot using a cloud dashboard.
Getting ready
For this final recipe, you just need to have followed all the previous recipes in the chapter.
How to do it...
As the code for this recipe is really similar to the code from previous recipes, I will only highlight the main differences here. You can, of course, refer to the GitHub repository of the book for more details.
You need to include the following libraries:
#include <SPI.h> #include <WiFi101.h> #include <PubSubClient.h> #include <aREST.h>
Then, an important point here is to define a unique ID for the robot:
char* device_id = "40ep12';
This will basically identify your robot on the aREST cloud. Then, inside the loop...