Created
April 5, 2016 23:04
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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