Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned long lastUploadTime = 0UL; //Don't change. Used to determine if samples need to be uploaded.
- const unsigned long updateFrequency = 20000UL; // Update frequency in milliseconds (20000 = 20 seconds).
- void setup() {
- }
- void loop() {
- unsigned long now = millis();
- if(now - lastUploadTime > updateFrequency)
- {
- lastUploadTime = now;
- FuelGauge fuel;
- char voltageBuf[15] = {0}; //Initialize buffer to nulls
- String(fuel.getVCell()).toCharArray(voltageBuf,10); //Convert float to string
- Spark.publish("f", voltageBuf, 60, PRIVATE);
- }
- }
Add Comment
Please, Sign In to add comment