Energy Monitor - emon

I am new to Arduino and am stuck with compiling the Emon sketch.

On compiling, get the error message : 'EnergyMonitor' does not name a type.

This is the line where it hangs.

EnergyMonitor emon1;             // Create an instance

 

nwashin1's picture

Re: Energy Monitor - emon

Like you I'm new to Arduino but luckily had quite a bit of programming experience with other languages.

With various sketches they call for object classes which are defined in libraries.

In this instance the "EnergyMonitor" class is defined in the "Emonlib" library which is downloadable from the following address:

https://github.com/openenergymonitor/EmonLib

When you go to the link there is a button with "Zip" on it, download the Zip file and save the contents into a folder under the "Libraries" directory of "Arduino-1.0" so on my computer I've saved the files to:

My Documents\OpenEnergyMonitor\arduino-1.0\libraries\EmonLib

Close down Arduino and restart it and then try compiling your code again.

You may find other libraries are required.

On the GITHUB where you found your original sketch file there is normally a readme displayed which details the libraries required.

Hopefully this helps.
 

 

Robert Wall's picture

Re: Energy Monitor - emon

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.