Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting raw PPG readings #30

Open
s1nisteR opened this issue Jan 21, 2024 · 1 comment
Open

Getting raw PPG readings #30

s1nisteR opened this issue Jan 21, 2024 · 1 comment

Comments

@s1nisteR
Copy link

Hello. How to go about using this sensor and this library to get raw PPG signals from the sensor? I've seen a library from https://github.com/Protocentral/protocentral-pulse-express which has a separate configRawMode function that outputs raw PPG signals. How would I go about doing such a thing using your library?

@s1nisteR
Copy link
Author

Apparently this is how the other library is doing it.

bool max32664::configRawdataMode(){

  //enter app mode
  bool ret = writeByte(0x01, 0x00, 0x00);
  delay(10);
  if(!ret){
    Serial.println("enter app mode cmd failed");
    return false;
  }

  //Set output mode to sensor data 
  ret = writeByte(0x10, 0x00, 0x01);
  delay(10);
  if(!ret){
    Serial.println("Set output mode to sensor data cmd failed");
    return false;
  }

  //Set sensor hub interrupt threshold
  ret = writeByte(0x10, 0x01, 0x0f);
  delay(10);
  if(!ret){
    Serial.println("Set interrupt threshold cmd failed");
    return false;
  }
  
  //Enable AFE
  ret = writeByte(0x44, 0x03, 0x01);
  delay(10);
  if(!ret){
    Serial.println("Enable AFE cmd failed");
    return false;
  }

  //Enable BPT algorithm in Estimation mode
  ret = writeByte(0x52, 0x04, 0x02);
  delay(10);
  if(!ret){
    Serial.println("Enable AFE cmd failed");
    return false;
  }

  //Disable AGC.
  ret = writeByte(0x52, 0x00, 0x00);
  delay(200);
  if(!ret){
    Serial.println("Disable AGC cmd failed");
    return false;
  }

  //led1
  ret = writeByte(0x40, 0x03, 0x0c, 0x7f);
  delay(10);
  if(!ret){
     Serial.println("LED1 (red) current set failed");
    return false;
  }
  
  //led2
  ret = writeByte(0x40, 0x03, 0x0d, 0x7f);
  delay(10);
  if(!ret){
    Serial.println("LED2 (IR) current set failed");
    return false;
  }

  Serial.println("Device configured in rawdata mode");
  return true;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant