Skip to content

Instantly share code, notes, and snippets.

@Robotonics
Created April 5, 2016 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Robotonics/f8c74ec14c1f9d9f68d4cebd6c4659f0 to your computer and use it in GitHub Desktop.
Save Robotonics/f8c74ec14c1f9d9f68d4cebd6c4659f0 to your computer and use it in GitHub Desktop.
Creates two Particle cloud variables, one ( fuelval ) for battery voltage, and the other ( fuelper ) for battery percentage remaining.
// Project created by David Cotterill-Drew- Just to learn and have fun!
// 05/04/2016 23:08 GMT
#include "application.h"
double fuelval;
double fuelper;
FuelGauge fuel;
void setup()
{
fuelval=fuel.getVCell();
fuelper=fuel.getSoC();
}
void loop()
{
fuelval=static_cast<double>(fuel.getVCell());
fuelper=static_cast<double>(fuel.getSoC());
Particle.variable("Voltage" ,fuelval );
Particle.variable("Percent", fuelper);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment