View on GitHub

MAX1704X Arduino Library

Arduino library for MAX17043/MAX17044 lithium ion battery fuel gauge.

Home - Getting Started - Constructor - Initialization - Functions - Examples

deviceFound() - findFirstDevice() - address() - adc() - voltage() - percent() - version() - compensation() - sleep() - isSleeping() - wake() - reset() - quickstart() - alertIsActive() - clearAlert() - threshold()

sleep()

Description

Puts the device into sleep mode. While in Sleep mode, all IC operations are halted, and power drain of the IC is greatly reduced. After exiting Sleep mode, fuel-gauge operation continues from the point it was halted.

Parameters

None

Returns

successful : bool

Example

The sample code below demonstrates how to check if the device is in sleep mode and then puts it in sleep mode if it is not.

if (!FuelGauge.isSleeping())
{
  FuelGauge.sleep();

  if (FuelGauge.isSleeping())
  {
	Serial.println("Fuel Gauge put in sleep mode.");
  }
  else
  {
	Serial.println("Fuel Gauge failed to be put in sleep mode.");
  }
}
else
{
  Serial.println("Fuel Gauge is already in sleep mode.");
}

Notes

Entering Sleep mode does not clear the interrupt. See also wake() and isSleeping().