View on GitHub

MAX1704X Arduino Library

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

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

SDA/SCL - SDA/SCL/Address

SDA/SCL/Address

Description

Performs an initialization of the library which includes calling Wire.begin() using the specified SDA and SCL pins and address for your board.

Parameters

sda : int

scl : int

address : uint8_t

Returns

successful: bool

Example

#include <MAX17043.h>

void setup()
{
  Serial.begin(9600);
  FuelGauge.begin(33, 32, 0x32);
}

void loop()
{
  Serial.print("Battery percentage is ");
  Serial.print(_fuelGauge.percent());
}

or

#include <MAX1704X.h>

MAX1704X _fuelGauge = MAX1704X(MAX17043_mV); 

void setup()
{
  Serial.begin(9600);
  _fuelGauge.begin(33, 32, 0x32);
}

void loop()
{
  Serial.print("Battery percentage is ");
  Serial.print(_fuelGauge.percent());
}

Notes

None