I am working on a project that measures instantaneous current & voltage of a device and also incorporates RFID to identify a device as well. As I am new to programming and arduino environment, I started with measuring current & voltage first. I found this code to measure current & voltage using arduino uno. But unfortunately when I try to compile the sketch, I encounter error. Can someone please help me with the issue?
I followed the following procedure to compile:
1. Downloaded EmonLib folder bearing (.cpp & .h) files from github and placed it in my arduino libraries folder ( https://github.com/openenergymonitor/EmonLib
2. Uploaded the voltage and current sketch as follows:
#include "EmonLib.h" // Include Emon Library
EnergyMonitor emon1; // Create an instance
emon1.voltage(2, 234.26, 1.7); // Voltage: input pin, calibration, phase_shift
emon1.current(1, 111.1); // Current: input pin, calibration.
emon1.calcVI(20,2000); // Calculate all. No.of wavelengths, time-out
emon1.serialprint(); // Print out all variables
3. Clicked Compile to check if the code works.
And the reuslt was "Error Compiling"