I used AD8232 and esp32 to design an ECG monitor system, however came through the problem that the output is obviously wrong, it didn't hace a R wave and T wave, and I also wondering that if it's wrong that the output always drop down to 0?
For hardware connection. I used Power supply generator for AD8232 module, and choose esp32-s for the microcontrollor.
The code is as follow:

Sinserely hoping for an answer.