bridge2.setAuthToken(ljF4YLcyFN9P6iVeze92GsffvGwSeb2J);// <-- wrong format
bridge2.setAuthToken(BridgeAuth2); // right format
->> bridge , not Bridge
bridge2.setAuthToken(ljF4YLcyFN9P6iVeze92GsffvGwSeb2J);// <-- wrong format
bridge2.setAuthToken(BridgeAuth2); // right format
->> bridge , not Bridge
You forgot to connect Blynk and your code to send analogRead is wrong
You have to read analog pin with timer function and send to bridge
I canât see any Bridge2 in your code
And as @PeteKnight said, you have to learn how blynk works before trying to send value with bridge
You have no connection , I donât see any Blynk.connect();
@Yash69 please DO NOT create multiple logins to the forum.
Your @Yash68 login has been deleted and if you do this again your IP address and email will be blocked.
Pete.
I didnât even notice
And I canât write his code, he has to learn before .
You can search for such you know
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <SimpleTimer.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "qmppE8kZmNhF8zTuaQdi__QnmIL-Dw1u";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "nitinpa";
char pass[] = "nitinpa1";
char BridgeAuth2[] = "ljF4YLcyFN9P6iVeze92GsffvGwSeb2J";
SimpleTimer timer;
WidgetBridge bridge1(V1);
WidgetBridge bridge2(V2);
void setup(){
Blynk.begin(auth, ssid, pass);
while (Blynk.connect() == false) {
}
int A36 = analogRead(36);
int A39 = analogRead(39);
int A34 = analogRead(34);
int A35 = analogRead(35);
int A32 = digitalRead(32);
int A33 = digitalRead(33);
bridge2.virtualWrite(V1, A36);
timer.setInterval(10);
bridge2.virtualWrite(V2, A39);
timer.setInterval(12);
bridge2.virtualWrite(V3, A34);
timer.setInterval(14);
bridge2.virtualWrite(V4, A35);
timer.setInterval(16);
bridge2.virtualWrite(V5, A32);
timer.setInterval(18);
bridge2.virtualWrite(V6, A33);
timer.setInterval(20);
}
BLYNK_CONNECTED() {
bridge2.setAuthToken("BridgeAuth2"); // Token of the hardware B
}
void loop()
{
Blynk.run();
timer.run();
}
I am trying to read analog pins with timer function it is showing an error
redefinition of âclass BlynkTimerâ
is there anything else wrong in this code? xd
I read the post and modified the code but it is still showing an error
here is the code
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Blynk.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "qmppE8kZmNhF8zTuaQdi__QnmIL-Dw1u";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "nitinpa";
char pass[] = "nitinpa1";
char BridgeAuth2[] = "ljF4YLcyFN9P6iVeze92GsffvGwSeb2J";
BlynkTimer timer;
WidgetBridge bridge1(V1);
WidgetBridge bridge2(V2);
void setup(){
Blynk.begin(auth, ssid, pass);
while (Blynk.connect() == false) {
}
int A36 = analogRead(36);
int A39 = analogRead(39);
int A34 = analogRead(34);
int A35 = analogRead(35);
int A32 = digitalRead(32);
int A33 = digitalRead(33);
bridge2.virtualWrite(V1, A36);
timer.setInterval(10);
bridge2.virtualWrite(V2, A39);
timer.setInterval(12);
bridge2.virtualWrite(V3, A34);
timer.setInterval(14);
bridge2.virtualWrite(V4, A35);
timer.setInterval(16);
bridge2.virtualWrite(V5, A32);
timer.setInterval(18);
bridge2.virtualWrite(V6, A33);
timer.setInterval(20);
}
BLYNK_CONNECTED() {
bridge2.setAuthToken("BridgeAuth2"); // Token of the hardware B
}
void loop()
{
Blynk.run();
timer.run();
}
and here is the error
âTimerâ does not name a type
You have to learn guy
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Blynk.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "qmppE8kZmNhF8zTuaQdi__QnmIL-Dw1u";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "nitinpa";
char pass[] = "nitinpa1";
char BridgeAuth2[] = "ljF4YLcyFN9P6iVeze92GsffvGwSeb2J";
BlynkTimer timer;
WidgetBridge bridge1(V1);
WidgetBridge bridge2(V2);
void setup() {
Blynk.begin(auth, ssid, pass);
while (Blynk.connect() == false) {
}
timer.setInterval(1000L, Reading);
}
void loop()
{
Blynk.run();
timer.run();
}
void Reading(){
int A36 = analogRead(36);
int A39 = analogRead(39);
int A34 = analogRead(34);
int A35 = analogRead(35);
int A32 = digitalRead(32);
int A33 = digitalRead(33);
bridge2.virtualWrite(V1, A36);
bridge2.virtualWrite(V2, A39);
bridge2.virtualWrite(V3, A34);
bridge2.virtualWrite(V4, A35);
bridge2.virtualWrite(V5, A32);
bridge2.virtualWrite(V6, A33);
}
BLYNK_CONNECTED() {
bridge2.setAuthToken("BridgeAuth2"); // Token of the hardware B
}
can I lower the delay?
to 100ms
Hmm, where to begin?
Iâm guessing that you donât understand the basics of a C++ program structure, and that the void setup()
function runs just once, at start-up.?
Youâre also using the Blynk.connect()
command, and I guess you really mean Blynk.connected()
, although that whole piece of code is unnecessary anyway.
If you bother to read the link to my âUsing BlynkTimerâŚâ post then youâll also realise that the syntax of theses commands is wrongâŚ
Youâd really be better scrapping your existing code and starting with this code on your âsendingâ device, and simply adding-in more commands into the void blynkAnotherDevice()
function to send data to other virtual pins via the bridgeâŚ
Pete.
yep I donât understand c++ yet
I am starting to learn it
You can try.
what is analyzed? is 100ms really necessary?
Yes 100 ms is needed
I need answer : what is analyzed?
joysticks output to control something
So, youâre using hardware joysticks connected to an ESP32, rather than joystick widgets in the app?
Which is why you need to use Bridge code.
Good luck with getting a responsive result with that setup!
BTW, did you know that the version of Blynk that you are currently using will be switched-off in 6 months or so?
Pete.