Last active
April 1, 2021 05:11
-
-
Save arduinothai/5883e5fa61eea7835be9cce341ef771c to your computer and use it in GitHub Desktop.
ดาวโหลด Library https://github.com/openenergymonitor/EmonLib
This file contains 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
#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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment