Need Help to display ECG Graphs on Blynk using ESP32 and AD8232

I’ve been trying to plot AD8232 and ESP32 ECG data using Blynk, but what is displayed is smooth, clear hospital monitor electrocardiograms. The wave is nosey, unstable, or does have any clear peaks and patterns of an authentic ECG. What I am looking for is clear, live plots of accurate representation of cardiac activity, such as on medical monitors. No amount of pushing, either the signal is unstable or does plot on Blynk. In dire need of help in optimizing data treatment, eliminating nosey signals, and optimizing plots to have clear and accurate ECG waveforms. Can you give please give me a code that can show an authentic ECG data.

#define BLYNK_TEMPLATE_ID "YOUR_TEMPLATE_ID"
#define BLYNK_TEMPLATE_NAME "YOUR_TEMPLATE_NAME"

#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <BlynkSimpleEsp32.h>

char auth[] = "YOUR_BLYNK_AUTH_TOKEN";
char ssid[] = "YOUR_WIFI_SSID";
char pass[] = "YOUR_WIFI_PASSWORD";

#define ECG_PIN 32  // AD8232 OUTPUT connected to GPIO 32
#define THRESHOLD 500  // Adjust based on ECG signal strength

BlynkTimer timer;

void sendECG() {
    static int lastValue = 0;
    static bool peakDetected = false;

    int ecgValue = analogRead(ECG_PIN);
    Serial.println(ecgValue); // Print ECG data to serial monitor

    // Detect peaks
    if (ecgValue > THRESHOLD && !peakDetected) {
        peakDetected = true;
        Blynk.virtualWrite(V1, ecgValue); // Send ECG peak to Blynk
    } 
    else if (ecgValue < THRESHOLD - 50) {
        peakDetected = false; // Reset peak detection
    }
}

void setup() {
    Serial.begin(115200);
    Blynk.begin(auth, ssid, pass);

    timer.setInterval(10L, sendECG); // Send ECG data every 10ms
}

void loop() {
    Blynk.run();
    timer.run();
}



}

@Harsh1 Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

Thanks, I fixed it now.

You can’t send more than 10 pieces of data per second to Blynk. You are trying to send 100 per second.

Blynk is not designed to do what you are trying to do with it, so your efforts will never succeed.

Pete.

So, what should I do to change it?

Use a different platform, Blynk cannot do what you want.

Pete.

Thanks, a lot you really helped me out.

Do you know any platform that is free that could give me a desired output.

Not personally, no.
I’m a Blynk user and this is the Blynk forum, so you’re unlikely to get much info about alternate software platforms here.

Pete.

You can try uploading batches with HTTPs API

You, know what software could I use for free that I could get a HTTPs and API and can you give me a code that could display ECG graphs.