Skip to content

Instantly share code, notes, and snippets.

@ArduinoDiscordBot
Created January 7, 2021 09:16
Show Gist options
  • Save ArduinoDiscordBot/d591e25e5fba28a931f47b071867b798 to your computer and use it in GitHub Desktop.
Save ArduinoDiscordBot/d591e25e5fba28a931f47b071867b798 to your computer and use it in GitHub Desktop.
Code by draxxy#5732 - Thu Jan 07 2021 09:16:14 GMT+0000 (Coordinated Universal Time)

This gist was pasted by the Arduino discord server bot.

This gist was automatically pasted at the request of the code author or one of the discord server helpers. If you have any suggestions or bugs to report, you can do so on our GitHub repository, or in our discord server. This project is run by volunteers so feel free to fork and commit your changes then open a pull request!


⬇️ Pasted Code ⬇️

#include "EmonLib.h"
EnergyMonitor emon1;
void setup()
{
Serial.begin(9600);
emon1.current(34, 111.1); // Current: input pin, calibration.
}
void loop()
{
double Irms = emon1.calcIrms(1480); // Calculate Irms only
Serial.print("Apparent power:");
Serial.print(Irms*238.0); // Apparent power
Serial.print(" ");
Serial.print("Irms:");
Serial.println(Irms); // Irms
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment