@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.
@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.
idk how to use blynk new version and i want to control my devices even when i do not have my phone its the reason for choosing bridge when this blynk shut down then i will switch to the blynk iot
hey can I use
int pindata = param.asmap
instead of int pindata = param.asint
Better to wire up the joystick to the same ESP32, then write your code to accept either control. And consider provisions to allow the code to run in case server connectivity is also lost.
Only if you want a compiling error. These are the Virtual Pin data types allowed.
To interpret incoming data as Integers, Floats, Doubles and Strings use:
param.asInt();
param.asFloat();
param.asDouble();
param.asStr();
You can also get the RAW data from the param buffer:
param.getBuffer()
param.getLength()