BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

No data in app

Can you help me? No data in app…

#include <ESP8266WiFi.h> 
#include <BlynkSimpleEsp8266.h> 
#include <BreathDetector.h> 
BreathDetector MyDetector(A0); 
int x, x0, a; 
float out_relax, in_normal; 
int error; 
#define analogPin A0 
BlynkTimer timer; 
 
 
char auth[] = "HQS03enltJfi4hKlm6pmIrVqI_bwOzXa"; 
char ssid[] = "YA"; 
char pass[] = "qwerty123321"; 
 
 
 
void Send() 
{ 
 a = analogRead(A0); 
for (int k = 0; k < 5; ++k){ 
 
 
 x = map( analogRead(A0), 0, 1023, -100, 100); 
// Serial.println(x0 - x); 
 a = x0 - x; 
 
 
 } 
Serial.println(a); 
Blynk.virtualWrite(V1,a); 
} 
 
void setup() 
{ 
pinMode(analogPin, INPUT); 
Serial.begin(115200); 
Blynk.begin(auth, ssid, pass); 
timer.setInterval(1000,Send); 
} 
 
//void sendTemps() 
//{for (int k = 0; k < 5; ++k){ 
// 
// 
// x = map( analogRead(A0), 0, 1023, -100, 100); 
//// Serial.println(x0 - x); 
// a = x0 - x; 
//sensors.requestTemperatures(); 
//float dx = sensors.getTempCByIndex(0); 
//float dx1 = sensors.getTempCByIndex(1); 
//Serial.println(temp); 
//Blynk.virtualWrite(A0, dh); 
////Blynk.virtualWrite(V2, dx1); 
//} 
 
void loop() { 
 Blynk.run(); 
 Send(); 
 timer.run(); 
}```

Take this line out of your void loop. You’re calling the Send function with a timer every second, but this is trying to call the Send routine every time the void loop executes (potentially thousands of times per second) so your’e flooding the server with virtualWrite requests.

Pete.

I took out, but it still doesn’t work

What type of widget is attached to pin V1?

Pete.

Temperature sensor

Actually it is attached to pin A0

Where is the x0 value generated? What is the purpose of looping 6 times?

Any ideas what is wrong?

Maybe, if you answer this question…

Pete.

Seems you have attached a timer widget in V1…
Attach value display instead…