Hey , i’m doing an IoT project with the AD8232 module and ESP32 to see the ECG signal in the App. The problem appears when I mix the code to display the signal and send data to Blynk since the data is not plotted correctly.
I’m nearly sure that the problem has to be with the time of the signal but I’m relatively new in this (IoT) and I have no idea how to fix the code.
The code i have so far is :
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
BlynkTimer timer;
char auth[] = "xxxxx";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxxx";
char pass[] = "xxxxx";
const int heartPin = A0;
void setup() {
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
timer.setInterval(5, sendUptime);
}
void sendUptime()
{
int heartValue = analogRead(heartPin);
Serial.println(heartValue);
delay(1);
Blynk.virtualWrite(V0,heartValue);
}
void loop() {
Blynk.run();
timer.run();
}
I was trying to use BlynkTimer but I couldn’t make it work propperly. The image is the output when I have the IoT communication , when I have not the output signal is correctly.I’ll appreciate any help.