Listing 4-1 – Arduino sketch for controlling the Mini Round Robot

Listing 4-1 presents the complete Arduino sketch that can be used to control the Mini Round Robot with the Joystick widget on the Blynk app:

#include <ESP8266WiFi.h>#include <BlynkSimpleEsp8266.h>#include <Wire.h>#include <Adafruit_MotorShield.h>// You should get Auth Token in the Blynk App.// Go to the Project Settings (nut icon).char auth[] = "da999e8ef4ac42148f9fe8427dxxxxxx";// Your WiFi credentials.// Set password to "" for open networks.char ssid[] = "xxxxxx";char pass[] = "xxxxxx";Adafruit_MotorShield AFMS = Adafruit_MotorShield();Adafruit_DCMotor *L_MOTOR = AFMS.getMotor(4);Adafruit_DCMotor *R_MOTOR = AFMS.getMotor(3);// This function will be called every time Joystick ...

Get ESP8266 Robotics Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.