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

MAX30205 shutdown function not working #5

Open
Autobot86 opened this issue Apr 11, 2018 · 1 comment
Open

MAX30205 shutdown function not working #5

Autobot86 opened this issue Apr 11, 2018 · 1 comment

Comments

@Autobot86
Copy link

I develop simple temperature reading using Protocentral_MAX30205 with arduino nano, I try to consume my current consumption using shutdown mode function but MAX30205 doesn't go to sleep mode It's maintain 2mA current every time so please help me how to put sleep mode in MAX 30205

this is my code

#include <Wire.h>
#include "Protocentral_MAX30205.h"
MAX30205 tempSensor;

void setup() {
// put your setup code here, to run once:
Wire.begin();
Serial.begin(9600);
tempSensor.begin(); // set continuos mode, active mode
}

void loop() {

float temp = tempSensor.getTemperature(); // read temperature for every 100ms
Serial.print(temp ,2);
Serial.println("'c" );

tempSensor.shutdown();
delay(1000);
}

@tonialomar
Copy link

I think it's too late now but I will answer anyway..

Modify the .cpp library file like this.

void MAX30205::shutdown(void){ uint8_t reg = I2CreadByte(sensorAddress, MAX30205_CONFIGURATION); // Get the current register I2CwriteByte(sensorAddress, MAX30205_CONFIGURATION, reg | 0x01); }

Notice second line changed from 0x08 to 0x01. The idea is to set the Shutdown Bit in the Config Register.

Toni.

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

2 participants