Listing 3-1 – Displaying average of the pulses generated by the two wheel encoders (the hall-effect sensors)

 The following is the counting of the average pulses generated by the wheel encoder:

#include <ESP8266_Lib.h>#include <BlynkSimpleShieldEsp8266.h>#include <SparkFun_TB6612.h>char auth[] = "53e4da8793764b6197fc44a673ce4e21";char ssid[] = "YourNetworkName";char pass[] = "YourPassword";#include <SoftwareSerial.h>SoftwareSerial EspSerial(2, 3); // RX, TX#define ESP8266_BAUD 115200ESP8266 wifi(&EspSerial);#define AIN1 12#define BIN1 7#define AIN2 4#define BIN2 8#define PWMA 5#define PWMB 6#define STBY 9const int offsetA = 1;const int offsetB = 1;Motor motor1 = Motor(AIN1, AIN2, PWMA, offsetA, STBY);Motor motor2 = Motor(BIN1, BIN2, PWMB, ...

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.