hey all
i was hoping if you guys can help me with my project. i want to send 2 different things from the 1st esp32 to 2nd one. im sending 2 signals and each signal will turn on/off a specif led. to simplify the problem:
blynk app —> virtual pin 0 of the 1st esp 32 -----> bridge1(V1) ---->turn on/off led on pin 21
blynk app —> virtual pin 3 of the 1st esp 32 -----> bridge2(V2) ---->turn on/off led on pin 5
yesterday it was only working on pin 21. but today when i rewrote the code again its only working on pin 5 and nothing happens to pin 21
this is the code im using for the 1st esp 32
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char auth[] = "xxxxx";
char ssid[] = "xxxx";
char pass[] = "xxxxx";
WidgetBridge bridge1(V1);
WidgetBridge bridge2(V2);
int x= 21;
int y = 5;
BLYNK_WRITE(V0){
int x = param.asInt();
if (x == HIGH){
bridge1.digitalWrite(21, HIGH);
}
else {
bridge1.digitalWrite(21, LOW);
}
}
BLYNK_WRITE(V3){
int y = param.asInt();
if (y==HIGH){
bridge2.digitalWrite(5,HIGH);
}
else {
bridge2.digitalWrite(5, LOW);
}
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}
BLYNK_CONNECTED(){
bridge2.setAuthToken("xxxxxx");
}
void loop()
{
Blynk.run();
}
for the 2nd esp im using the wifi example and only changed authtoken and wifi ssid and pass.
note: sorry english is my second language