Hello,
I have a basic project with the Boron that sends the results of the fuel gauge to the events console.
The battery is fully charged and connected to the Boron which powers up and receives the flash. (battery level also checked with a volt-meter)
I keep getting “-1” as the result of the readings (including the system version). The summary code is as follows:
FuelGauge fuel; // declare the library
float voltage = fuel.getVCell();
float percent = fuel.getSoC();
float normal = fuel.getNormalizedSoC();
int ver = fuel.getVersion();
int val = 19; //used as a test number to send
Particle.publish(“TEST volt”, String(voltage) , PRIVATE);
delay (3000);
Particle.publish(“TEST percent”, String(percent) , PRIVATE);
delay (3000);
Particle.publish(“TEST normal”, String(normal) , PRIVATE);
delay(3000);
Particle.publish(“TEST version”, String(ver) , PRIVATE);
delay(3000);
Particle.publish(“TEST value”, String(val) , PRIVATE);
All of the battery results return: -1.000000
The version test returns: -160
The test number of 19 returns: 19
In short, the battery functions are returning a negative number including the fuel version. The test number of 19 returns as a positive number.
I did read in the “fuel gauge documentation” that the functions return -1.0 if the fuel gauge cannot be read.
Any help or comments are appreciated.
Thank you