Testing the motors

Before we actually control the robot from the cloud, we are going to perform a simple test to see whether the motors are working correctly. This will also allow you to see how to write code to control the motors.

This is the complete sketch for this part:

// Define motor pins int motorOnePlus = 12; int motorOneMinus = 13; int motorOneEnable = 14; int motorTwoPlus = 5; int motorTwoMinus = 16; int motorTwoEnable = 4; void setup() { Serial.begin(1152000); // Set pins pinMode(motorOnePlus, OUTPUT); pinMode(motorOneMinus, OUTPUT); pinMode(motorOneEnable, OUTPUT); pinMode(motorTwoPlus, OUTPUT); pinMode(motorTwoMinus, OUTPUT); pinMode(motorTwoEnable, OUTPUT); } void loop() { // Accelerate forward setMotorOne(true, 500); setMotorTwo(true, ...

Get Internet of Things with ESP8266 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.