ESP8266 Standalone won't compile BYLNK_WRITE

Hi,

I’m experimenting with an ESP8266 standalone, I can compile the example program for the ESP8826 without any problems, but when I try to compile a program that uses BLYNK_WRITE

I get this

In file included from C:\Program Files (x86)\Arduino\libraries\Blynk/Blynk/BlynkApi.h:17:0,
             from C:\Program Files (x86)\Arduino\libraries\Blynk/BlynkApiArduino.h:14,
             from C:\Program Files (x86)\Arduino\libraries\Blynk/BlynkSimpleEsp8266.h:15,
             from ESPBlynkCar.ino:21:
ESPBlynkCar.ino: In function 'void BlynkWidgetWrite3(BlynkReq&, const BlynkParam&)':
C:\Program Files (x86)\Arduino\libraries\Blynk/Blynk/BlynkHandlers.h:30:10: error: redefinition     of 'void BlynkWidgetWrite3(BlynkReq&, const BlynkParam&)'
     void BlynkWidgetWrite ## pin (BlynkReq& request, const BlynkParam& param)
          ^
ESPBlynkCar.ino:112:1: note: in expansion of macro 'BLYNK_WRITE'

I’m use Arduino IDE 1.6.4 on Windows 7. the ESP modules are 1.6.4-673-g8cd3697.
The Blynk library is most recent available on git.

My program looks like;

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

// Pin definitions
#define  IN1  2
#define  IN2  4
#define  IN3  5
#define  IN4  15
char auth[] = "4664492b01274bab8fa108ce68ade4d5";

/* Forward */
BLYNK_WRITE(1)
{
  if( param.asInt())
  {
    digitalWrite( IN1, 1);
    digitalWrite( IN2, 0);
    digitalWrite( IN3, 1);
    digitalWrite( IN4, 0);
  }
  else
  {
    digitalWrite( IN1, 0);
    digitalWrite( IN2, 0);
    digitalWrite( IN3, 0);
    digitalWrite( IN4, 0);
  }  
}

/* Backward 2 */
BLYNK_WRITE(2)
{
  if( param.asInt())
  {
    digitalWrite( IN1, 0);
    digitalWrite( IN2, 1);
    digitalWrite( IN3, 0);
    digitalWrite( IN4, 1);
  }
  else
  {
    digitalWrite( IN1, 0);
    digitalWrite( IN2, 0);
    digitalWrite( IN3, 0);
    digitalWrite( IN4, 0);
  }  
}  

void setup()
{
//  Serial.begin(9600);
  Blynk.begin(auth, "maddock3", "secret", IPAddress(10,0,0,8), 8442);
  pinMode( IN1, OUTPUT);
  pinMode( IN2, OUTPUT);
  pinMode( IN3, OUTPUT);
  pinMode( IN4, OUTPUT);
  digitalWrite( IN1, 0);
  digitalWrite( IN2, 0);
  digitalWrite( IN3, 0);
  digitalWrite( IN4, 0);  
}

void loop()
{
  Blynk.run();
}

Hi,

Never mind about this, I did some debugging and found I was using BLYNK_WRITE(3) twice in my code (Doh!!)

@NickM

Heh, glad you did it =).