Hi,
I have been running the below code on three different Particle Electrons for over a year now. I just flashed the same code on a new Electron and dont get the Values shown. Project comes online then sleeps as normal. Has something changed or have i Been lucky it worked?
#include <blynk.h>
#include <HX711ADC.h>
#define BLYNK_IP IPAddress(45,55,96,146)
#define zero_factor 70427 //This large value is obtained using the SparkFun_HX711_Calibration sketch
#define battsoc V6
BlynkTimer timer;
FuelGauge fuel;
HX711ADC scale(D3, D4);
char auth[] = "********************"; //
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, BLYNK_IP);
Serial.print("read: \t\t");
Serial.println(scale.read()); // print a raw reading from the ADC
Serial.print("read average: \t\t");
Serial.println(scale.read_average(40)); // print the average of 20 readings from the ADC
scale.set_scale(42690.f);
scale.set_offset(zero_factor); //Zero out the scale using a previously known zero_factor
Serial.print("read: \t\t");
Serial.println(scale.read()); // print a raw reading from the ADC
Serial.println("Readings:");
delay(10);
Serial.print("one reading:\t");
Serial.print(scale.get_units(), 2);
Serial.print("\t| average:\t");
Serial.println(scale.get_units(), 2);
Blynk.virtualWrite(V5, scale.get_units());
BLYNK_READ(battsoc);
Blynk.virtualWrite(battsoc, fuel.getSoC());
Blynk.run();
delay(5000);
System.sleep(SLEEP_MODE_DEEP, 60 * 60);
}
void loop()
{
}