FuelGauge functions, missing documentation?

Sorry if this has been documented or discussed elsewhere, but I can’t for the life of me find any documentation for the following functions in the FuelGauge library:


I’d rather not invent the wheel by creating my own alert threshold function, but all I can find on the library functions that I mentioned is just the passing mention here:

I would greatly appreciate any pointers and/or hints on the proper usage of these functions.

Ok, I found the SparkFunMAX17043 library reference, which it appears the Particle FuelGauge library was based on.

Unfortunately, the FuelGauge library doesn’t seem to be properly initializing when I call quickStart(), and it never registers above 83%, even when fully charged (using the 2000mAH lipo from the asset tracker kit). Do I need to manually set the lipo capacity using the FuelGauge library, or should quickStart() automatically calibrate everything properly?

you’re talking about the Electron, I assume. And yeah, mine never shows above 83% or so (I don’t remember the exact percentage offhand). Further, are you able to properly init a global FuelGauge? It fails when I attempt to do so- I can only define it within a function.

The SparkFun gauge, used on the Photon, doesn’t have either of the above problems.

Yes, this is regarding the Electron. Interesting that you’re seeing the same SOC reporting issue…
FuelGauge seems to be initializing fine for me, here is a snippet from my code–

// This #include statement was automatically added by the Spark IDE.
#include "TinyGPS.h"
String LastLocation;
FuelGauge fuel;
TinyGPS gps;

void setup(){
    Particle.function("pubstatus", PubStatus);

void loop(){

int PubStatus(String checkstatus) {
  String str = LastLocation + " - Battery: " + String(long(fuel.getSoC())) + "%";
	Particle.publish(CurrentState, str);

By chance, have you tried seeing if the SparkFun library is usable on the Electron? (not sure if it could be tweaked to work without clashing with the built-in library?)

@tedder @surfdaworld I find just declaring FuelGauge fuel; in the loop() seems to work:

loop() {
    FuelGauge fuel;
    sprintf(publishStr, "%02.2f %03.2f", fuel.getVCell(), fuel.getSoC());
    Particle.publish("e1", publishStr, 60, PRIVATE); 

   sleep.........or whatever

I have no idea what quickStart is supposed to do

messed up… VCell function ALWAYS returns 5.000 - I’m on battery only, no usb connection. It should be under 3.9 by now…