IP Configuration
This commit is contained in:
20
lib/EmonLib/examples/current_only/current_only.ino
Normal file
20
lib/EmonLib/examples/current_only/current_only.ino
Normal file
@@ -0,0 +1,20 @@
|
||||
// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3
|
||||
|
||||
#include "EmonLib.h" // Include Emon Library
|
||||
EnergyMonitor emon1; // Create an instance
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
|
||||
emon1.current(1, 111.1); // Current: input pin, calibration.
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
double Irms = emon1.calcIrms(1480); // Calculate Irms only
|
||||
|
||||
Serial.print(Irms*230.0); // Apparent power
|
||||
Serial.print(" ");
|
||||
Serial.println(Irms); // Irms
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3
|
||||
|
||||
#include "EmonLib.h" // Include Emon Library
|
||||
EnergyMonitor emon1; // Create an instance
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
|
||||
emon1.voltage(2, 234.26, 1.7); // Voltage: input pin, calibration, phase_shift
|
||||
emon1.current(1, 111.1); // Current: input pin, calibration.
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
emon1.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
|
||||
emon1.serialprint(); // Print out all variables (realpower, apparent power, Vrms, Irms, power factor)
|
||||
|
||||
float realPower = emon1.realPower; //extract Real Power into variable
|
||||
float apparentPower = emon1.apparentPower; //extract Apparent Power into variable
|
||||
float powerFActor = emon1.powerFactor; //extract Power Factor into Variable
|
||||
float supplyVoltage = emon1.Vrms; //extract Vrms into Variable
|
||||
float Irms = emon1.Irms; //extract Irms into Variable
|
||||
}
|
||||
Reference in New Issue
Block a user