Adafruit 'the thing' esp8266 servo control

I wanted to control a robot using blynk with adafruit "the thing " board. I’m new at using blynk and was unable to find ‘simple’ project to copy. Finally figured it out. I’m starting by controlling a continuous rotating servo. I have two buttons in ‘switch’ mode. When i push to ‘on’ position on V1[virtual pin] the servo rotates ccw, when i push to off position, it stops. On V2 button, it goes cw when pushed to on position. Powering servo with external p/s to avoid burning up esp8266! Works great. Using servo.h to make it easy.

#define BLYNK_PRINT Serial    // Comment this out to disable 
//prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Servo.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
Servo servo;
Servo servo2;
char auth[] = " "; // insert code here.

void setup()
  Blynk.begin(auth, "xxxxxx", "yyyyyy");
  servo.attach(0); //pin 0
  // servo2.attach(4); 

   if (param.asInt()){       
    } else {


   if (param.asInt()){    //button on.   
    } else { //button off.

void loop()

1 Like

Code snippet should be formatted. Edit your post!

Wrap the code by adding 3 Backtick: ``` symbols:


 ``` cpp <--put 3 backticks BEFORE your code starts  (cpp means C++ language) 

   //Put your code here

 ``` <--insert 3 backticks AFTER your code

**This makes your code readable and with highlighted syntax, like this:**
//comment goes here 
void helloWorld() { 
   String message =  "hello" + "world"; 

got it. Thanks for pointing that out. New at this:slight_smile:

1 Like