Hi, i got a problem when trying to make a simple example of turn on a digital pin which is connected to a LED with my Arduino Uno + ESP-01.
It is the example explained there: Send Device Data to Blynk - Blynk Documentation.
My code is:
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "*********";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "MiFibra-85CC";
char pass[] = "*******";
void setup()
{
pinMode(2,OUTPUT);
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}
int vPin2;
BLYNK_WRITE(V2)
{
vPin2 = param.asInt(); // assigning incoming value from pin V1 to a variable
if (vPin2 == 1){
digitalWrite(2,HIGH);
Serial.println("Hasta aqui llego 1");
}
else
{
digitalWrite(2,LOW);
Serial.println("Hasta aqui llego 2");
}
// process received value
}
void loop()
{
Blynk.run();
}
and that is what the serial monitor shows after upload it and press the button few times:
[68] Connecting to MiFibra-85CC
[4298] Connected to WiFi
[4298] IP: 192.168.1.33
[4299]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
///_, /////_
/__/ v1.0.0 on ESP8266
[4374] Connecting to blynk-cloud
[4508] Ready (ping: 43ms)
Hasta aqui llego 1
Hasta aqui llego 2
Hasta aqui llego 1
Hasta aqui llego 2
Hasta aqui llego 1
Hasta aqui llego 2
Hasta aqui llego 1
Hasta aqui llego 2
It seems to work all correctly but my pins don’t respond.
I also tried to load a program just using the Arduino Uno which is a simple blink of digital pin 3. It worked and when i tried to load the blynk program again it cotinued working as i said but arduino Uno keeps blinking LED in pin 3 (when it is not even used in this program, just in the program i loaded before) and not responding to the digitalWrite(2,HIGH); and digitalWrite(2,LOW); commands.
BTW: I connected pins 0 and 1 (RX and TX) to the ESP, GND to the grount of a power supply circuit of 3.3 V which aliment the ESP and i tested pins 2 and 3 connecting with a led + resistor and also with a voltimeter. in both modes worked only the pin 3.