Hello, Please help with my project, I want to use DHT11 and send data to blynk server every 10 s
I use Simple Timer but, when I compile. it gives error like this
In file included from C:\Users\Toif\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkApi.h:17:0,
from C:\Users\Toif\Documents\Arduino\libraries\blynk-library-master\src/BlynkApiArduino.h:14,
from C:\Users\Toif\Documents\Arduino\libraries\blynk-library-master\src/BlynkSimpleEsp8266.h:24,
from C:\Users\Toif\Desktop\j\sketch_nov25a\sketch_nov25a.ino:6:
C:\Users\Toif\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkTimer.h:39:36: error: conflicting declaration 'typedef void (* timer_callback)()'
typedef void (*timer_callback)(void);
^
C:\Users\Toif\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkTimer.h:38:35: error: 'timer_callback' has a previous declaration as 'typedef class std::function<void()> timer_callback'
typedef std::function<void(void)> timer_callback;
^
exit status 1
Error compiling for board LOLIN(WEMOS) D1 R2 & mini.
my code :
SimpleTimer timer;
void send() {
float h = dht.readHumidity();
float t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
Serial.println("Impossible de lire la sonde DHT!");
return; }
Blynk.virtualWrite(V2, h);
Blynk.virtualWrite(V3, t);
}
void setup()
{
pinMode(Relay_1, OUTPUT);
digitalWrite(Relay_1, HIGH);
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
dht.begin();
timer.setInterval(1000L, send);
}
I don’t know how to do. cause there is no solution on the net