Hi,
The following is my code for the ESP32 with ADS1292r breakout kit.
#include "protocentralAds1292r.h"
//#include "BLE2904.h"
#include "SPI.h"
// See the following for generating UUIDs:
// https://www.uuidgenerator.net/
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" //creating the service UUID
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" //creating the characteristics UUID
#define ESP32_V_SPI_CS_PIN 5
#define ADS1292R_PWRDN_PIN 2
#define ADS1292R_START_PIN 15
char Reg_read_data;
#define LED_BUILTIN 2 //pin with LED to turn on when BT connected
ads1292OutputValues* ADS1292RegValues;
ads1292r ECG_SENSOR_ADS1292R;
/-----------------Function to detect Lead off condition in ECG.----------------------/
bool leadoff_detect(bool LEADOFF_DETECT){
/* Setup for leads off detection for RLD and Lead sense*/
// ECG_SENSOR_ADS1292R.getAds1292EcgAndRespirationSamples(DATA_READY,CS,ADS1292RegValues);
// return ADS1292RegValues->leadoffDetected;
}
/------------------------------------------------------------------------------------/
/------------------------Setup or main function.---------------------------/
void setup() {
SPI.begin();
Serial.begin(9600); // define the baud rate of ESP32
/-------------------------------------------------------------------------------------------/
/-------------Setting up the Sensor------------------------/
ECG_SENSOR_ADS1292R.ads1292Reset(ADS1292R_PWRDN_PIN);
delay(1000);
ECG_SENSOR_ADS1292R.ads1292Init(ESP32_V_SPI_CS_PIN,ADS1292R_PWRDN_PIN,ADS1292R_START_PIN);
delay(1000);
Serial.println("ECG sensor initialised.");
//For Debug purpose only.
//Reading the Chip ID
ECG_SENSOR_ADS1292R.ads1292RegRead(ESP32_V_SPI_CS_PIN,ADS1292_REG_ID,Reg_read_data);
Serial.println("CHIP ID is:");
Serial.println(Reg_read_data,HEX);
}