November 2017
Beginner
210 pages
4h 41m
English
Listing 7-1 shows the Arduino sketch that can be used to control the gripper with the Blynk app. The functions for controlling the two DC gear motors are not included in the code to only focus on the gripper (servo). Upload the code to the Arduino using the Arduino IDE by connecting the Arduino to your computer with a USB A-to-B cable. After uploading the sketch, remove the USB cable from the Arduino.
Listing 7-1—Controlling the gripper with Blynk:
#include <ESP8266_Lib.h>#include <BlynkSimpleShieldEsp8266.h>#include <Servo.h>// You should get Auth Token in the Blynk App.// Go to the Project Settings (nut icon).char auth[] = "YourAuthToken";// Your WiFi credentials.// Set password to "" for open networks.char ssid[] = "YourNetworkName"; ...