Skip to content

Commit 347f616

Browse files
committed
extract all calculated values out into variables for easy access
1 parent 4ec3a8d commit 347f616

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/voltage_and_current/voltage_and_current.ino

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@ void setup()
1414
void loop()
1515
{
1616
emon1.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
17-
emon1.serialprint(); // Print out all variables
17+
emon1.serialprint(); // Print out all variables (realpower, apparent power, Vrms, Irms, power factor)
18+
19+
float realPower = emon1.realPower; //extract Real Power into variable
20+
float apparentPower = emon1.apparentPower; //extract Apparent Power into variable
21+
float powerFActor = emon1.powerFactor; //extract Power Factor into Variable
22+
float supplyVoltage = emon1.Vrms; //extract Vrms into Variable
23+
float Irms = emon1.Irms; //extract Irms into Variable
1824
}

0 commit comments

Comments
 (0)