Things used in this project

Hardware components:
A000066 iso both
Arduino UNO & Genuino UNO
×1
12002 04
Breadboard (generic)
×1
Esp01
Everything ESP ESP8266 ESP-01
×1
09670 01
SparkFun Dual H-Bridge motor drivers L298
×1
11026 02
Jumper wires (generic)
a lot
×1
09590 01
LED (generic)
×1
Mfr 25frf52 1k sml
Resistor 1k ohm
×1
DC motor (generic)
5V
×2

Schematics

ESP8266 wiring to firmware update with FLASH Download Tools
Esp8266 deploy fqkjbh5epj
ESP8266 witing to deploy HTTP Web Server with Arduino Board
Esp8266 arduino deploy 2yi0u7eeag
Arduino + L298N motor drive wiring
Motor l298n deploy pflhpjenzy

Code

Code1: esp8266_L298N.inoArduino
Create a WiFi access point and provide a web server on it to move robot.
/* Create a WiFi access point and provide a web server on it to move robot. 
 *  
 *  Important: Use without ATMega328 chip, or wire RST in GND
 *  
 *  Author: Lucio A. Rocha
 *  Last Update: 25 Jan 2017
 *
 */

#include <ESP8266WiFi.h>
#include <WiFiClient.h> 
#include <ESP8266WebServer.h>

/* Set these to your desired credentials. */
const char *ssid = "utfprbot";
const char *password = "654321";

ESP8266WebServer server(80);

const int led = 2;  //GPIO2

/* Just a little test message.  Go to http://192.168.4.1 in a web browser
 * connected to this access point to see it.
 */
void handleRoot() {

  int size=1000;
  char temp[size];
  
  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\    
    <title>UTFPRBOT-1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>You are connected on UTFPRBOT #1!</h3>\
    <p>Uptime: %02d:%02d:%02d</p>\    
    <p>Status: Light ON</h1></p>\
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );
  server.send ( 200, "text/html", temp );  
  
}

void setup() {
  delay(1000);
  Serial.begin(9600);
  Serial.println();
  Serial.print("Configuring access point...");

  /* You can remove the password parameter if you want the AP to be open. */
  WiFi.softAP(ssid, password);

  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);

  pinMode(led, OUTPUT);
  digitalWrite ( led, HIGH );

  //URLs available to query
  server.on("/", handleRoot);  
  server.on ( "/up", moveUp );        //1
  server.on ( "/lu", moveLeftUp );    //2
  server.on ( "/ru", moveRightUp );   //3
  server.on ( "/ld", moveLeftDown );  //4
  server.on ( "/rd", moveRightDown ); //5
  server.on ( "/do", moveDown );      //6
  server.on ( "/st", moveStop );      //7
  server.on ( "/on", turnOn );        //8
  server.on ( "/of", turnOff );       //9  
  
  server.begin();
  Serial.println("HTTP server started");
  
}

void moveUp(){

  digitalWrite ( led, HIGH );

  int size=1000;
  char temp[size];

  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\
    <title>UTFPRBOT - 1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>Request: Move UP</h3>\
    <p>Uptime: %02d:%02d:%02d</p>\
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );

  server.send ( 200, "text/html", temp);
  Serial.println("SETM1");
  
}

void moveLeftUp(){

  digitalWrite ( led, HIGH );

  int size=1000;
  char temp[size];

  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\
    <title>UTFPRBOT - 1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>Request: Move LEFT-UP</h3>\
    <p>Uptime: %02d:%02d:%02d</p>\
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );

  server.send ( 200, "text/html", temp);
  Serial.println("SETM2");
  
}

void moveLeftDown(){

  digitalWrite ( led, HIGH );

  int size=1000;
  char temp[size];

  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\
    <title>UTFPRBOT - 1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>Request: Move LEFT-DOWN</h3>\
    <p>Uptime: %02d:%02d:%02d</p>\
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );

  server.send ( 200, "text/html", temp);
  Serial.println("SETM4");
  
}

void moveRightUp(){

  digitalWrite ( led, HIGH );

  int size=1000;
  char temp[size];

  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\
    <title>UTFPRBOT - 1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>Request: Move RIGHT-UP</h3>\
    <p>Uptime: %02d:%02d:%02d</p>\
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );

  server.send ( 200, "text/html", temp);
  Serial.println("SETM3");
  
}

void moveRightDown(){

  digitalWrite ( led, HIGH );

  int size=1000;
  char temp[size];

  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\
    <title>UTFPRBOT - 1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>Request: Move RIGHT-DOWN</h3>\
    <p>Uptime: %02d:%02d:%02d</p>\
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );

  server.send ( 200, "text/html", temp);
  Serial.println("SETM5");
  
}

void moveDown(){

  digitalWrite ( led, HIGH );

  int size=1000;
  char temp[size];

  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\
    <title>UTFPRBOT - 1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>Request: Move DOWN</h3>\    
    <p>Uptime: %02d:%02d:%02d</p>\
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );

  server.send ( 200, "text/html", temp);
  Serial.println("SETM6");
  
}


void moveStop(){

  digitalWrite ( led, HIGH );

  int size=1000;
  char temp[size];

  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\
    <title>UTFPRBOT - 1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>Request: STOP</h3>\
    <p>Uptime: %02d:%02d:%02d</p>\
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );

  server.send ( 200, "text/html", temp);
  Serial.println("SETM7");
  
}

void turnOn(){

  digitalWrite ( led, HIGH );

  int size=1000;
  char temp[size];

  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\    
    <title>UTFPRBOT - 1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>Request: Light ON</h3>\
    <p>Uptime: %02d:%02d:%02d</p>\
    <p>Status: Light ON</p>\        
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );

  server.send ( 200, "text/html", temp);
  Serial.println("SETM8");
}

void turnOff(){

  digitalWrite ( led, LOW );

  int size=1000;
  char temp[size];

  int sec = millis() / 1000;
  int min = sec / 60;
  int hr = min / 60;

  snprintf ( temp, size,

"<html>\
  <head>\    
    <title>UTFPRBOT - 1.0</title>\
    <style>\
      body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
    </style>\
  </head>\
  <body>\
    <h3>Request: Light OFF</h3>\
    <p>Uptime: %02d:%02d:%02d</p>\
    <p>Status: Light OFF</p>\        
    <p><a href=\"http://192.168.4.1/on\"><h1>Turn ON</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/of\"><h1>Turn OFF</h1></a></p>\           
    <p></p>\
    <p><a href=\"http://192.168.4.1/st\"><h1 align=\"center\">STOP</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/up\"><h1 align=\"center\">/\\/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/lu\"><h1 align=\"center\">/\\_____</h1></a><a href=\"http://192.168.4.1/ru\"><h1 align=\"center\">_____/\\</h1></a></p>\
    <p></p>\
    <p><a href=\"http://192.168.4.1/ld\"><h1 align=\"center\">\\/_____</h1></a><a href=\"http://192.168.4.1/rd\"><h1 align=\"center\">_____\\/</h1></a></p>\
    <p><a href=\"http://192.168.4.1/do\"><h1 align=\"center\">\\/\\/</h1></a></p>\
    <p></p>\
  </body>\
</html>",

    hr, min % 60, sec % 60
  );

  server.send ( 200, "text/html", temp);
  Serial.println("SETM9");
}

void loop() {
  //IPAddress myIP = WiFi.softAPIP();
  //Serial.print("AP IP address: ");
  //Serial.println(myIP);
  server.handleClient();
}
Code2: SoftwareSerialArduino
Software to parse serial data from ESP8266 and
move motors controlled by L298N motor drive.
/*
SoftwareSerialParser
(based on SoftwareSerialExample.ino)

Description: Software to parse serial data from ESP8266 and
move motors controlled by L298N motor drive.

Author: Lucio A. Rocha
Last update: 12/03/2017

 */
#include <SoftwareSerial.h>

int IN3 = 8; //IN3 motor = pino no arduino
int IN4 = 7;
int ENB = 6; // ENB eh o pino de controle de velocidade no motor

int IN1 = 5; //IN1 motor = pino no arduino
int IN2 = 4;
int ENA = 3; // ENA eh o pino de controle de velocidade no motor

int TIME_MOVE=2000; //Tempo de cada movimento

SoftwareSerial mySerial(0, 1); // RX, TX

void setup() {

  pinMode(ENB, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);
  
  pinMode(ENA, OUTPUT);
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.println("SoftwareSerialParser Started!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  mySerial.println("Hello, world?");
}


void moveMotor(char c){
   
   Serial.println(c);

   switch (c){
    //Up
    case '1': 
      //Prepara a saida do motor
      digitalWrite(IN1, LOW);
      digitalWrite(IN2, HIGH);
      //Prepara a saida do motor
      digitalWrite(IN3, HIGH);
      digitalWrite(IN4, LOW);
      //Move
      analogWrite(ENA, 255);
      analogWrite(ENB, 255);
      delay(TIME_MOVE);  
      //Desliga o motor e espera
      analogWrite(ENA, 0);
      analogWrite(ENB, 0);      
      break;
    //LeftUp
    case '2':       
      //Prepara a saida do motor
      digitalWrite(IN3, HIGH);
      digitalWrite(IN4, LOW);
      //Move      
      analogWrite(ENB, 255);
      delay(TIME_MOVE);  
      //Desliga o motor e espera      
      analogWrite(ENB, 0);      
      break;      
    //RightUp
    case '3':       
      //Prepara a saida do motor
      digitalWrite(IN1, LOW);
      digitalWrite(IN2, HIGH);      
      //Move
      analogWrite(ENA, 255);      
      delay(TIME_MOVE);  
      //Desliga o motor e espera
      analogWrite(ENA, 0);
      break;
    //LeftDown
    case '4':       
      //Prepara a saida do motor
      digitalWrite(IN3, LOW);
      digitalWrite(IN4, HIGH);
      //Move      
      analogWrite(ENB, 255);
      delay(TIME_MOVE);  
      //Desliga o motor e espera      
      analogWrite(ENB, 0);      
      break;        
      //RightDown
    case '5':       
      //Prepara a saida do motor
      digitalWrite(IN1, HIGH);
      digitalWrite(IN2, LOW);      
      //Move
      analogWrite(ENA, 255);      
      delay(TIME_MOVE);  
      //Desliga o motor e espera
      analogWrite(ENA, 0);
      break;
      //Down
    case '6':                
//Prepara a saida do motor
      digitalWrite(IN1, HIGH);
      digitalWrite(IN2, LOW);
      //Prepara a saida do motor
      digitalWrite(IN3, LOW);
      digitalWrite(IN4, HIGH);
      //Move
      analogWrite(ENA, 255);
      analogWrite(ENB, 255);
      delay(TIME_MOVE);  
      //Desliga o motor e espera
      analogWrite(ENA, 0);
      analogWrite(ENB, 0);      
      break;
  //Stop
    case '7':                
      //Desliga o motor e espera
      analogWrite(ENA, 0);
      analogWrite(ENB, 0);      
      break;      
    default:
      break;
   }//end switch
 
}


void parseMove(String response){
      Serial.print("[");
      String movement="";
      int i=0;
      char c = response[i];
      while (i<4){ //Take first 5 chars from readings of ESP8266 line
        c = response[i];
        movement+=c;
        Serial.print(c);
        i=i+1;
     }
    //Takes on more char to identify the number of movement
    c = response[i];
    if (movement=="SETM"){     
      movement+=c;
      Serial.println("\n===========================================");      
      Serial.println(movement);
      Serial.println(c);

      //c is the number of movement
      moveMotor(c);

      Serial.println("-------------------------------------------");  
    }
     Serial.print("]");
}  

void loop() { // run over and over
  String response = "";
  bool achou=false;  
  while (mySerial.available()) {
    response = mySerial.readStringUntil('\n');
    Serial.println(response);

    parseMove(response);
   
  }
}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Voltmeter using Arduino
Easy
  • 435
  • 35

Protip

If you can't find voltmeter at home or at any other place, then this Hack is for you, Go ahead.

Voltmeter using Arduino

Team Next Tech Lab

Save your life with the Building Collapse Monitor
Easy
  • 197
  • 6

Full instructions

Analyse concrete, metal, wood structures for bends and angles and alerts if they have deviated from the original position.

Cloud-Based Temperature Logger for Homebrew Fermenter
Easy
  • 327
  • 7

Work in progress

Using battery powered NodeMCU v2 and DS18B20 thermometer to log temperature and system voltage on Google Sheets.

Arduino 101 - Intel Curie Pattern Matching Dress
Easy
  • 2,295
  • 21

Full instructions

A dress with Curie's pattern matching engine on Arduino101 to control the embedded LEDs, which makes constellations show up on the dress.

Hackster Live April 2017 Workshop - Optional - Easy Add-on
Easy
  • 116
  • 2

Full instructions

Adapt your home automation project from our March 2017 workshop to be controlled through BLE using the Blynk app on your phone.

Arduino Morse Code Machine
Easy
  • 856
  • 12

Full instructions

A simple arduino Morse code machine with a button,led and a buzzer that takes your input and translates it into English while you are typing

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback