In this recipe, we are finally going to dive into the core of this chapter: making our robot move around! We'll learn how to configure it so it can receive commands via Wi-Fi, and then we'll learn how to control it using a simple interface running inside your browser.
For this recipe, just make sure that you followed all the recipes so far in the chapter. Also, it is recommended to leave the robot in a position where the wheels or track are not touching the ground, at least till you are sure it is working correctly.
We are now going to program the robot so it accepts commands via Wi-Fi. For that, we'll use the aREST framework that we have already used several times in this book.
The sketch starts by including the required libraries:
#include <SPI.h> #include <WiFi101.h> #include <aREST.h>
Then, you need to define your Wi-Fi network name and password:
char ssid[] = "wifi-name'; char password[] = "wifi-pass';
After that, we declare...