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
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:
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:
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.
See here: http://openenergymonitor.org/emon/node/624
Open-source tools for energy monitoring and analysis. This project uses the GNU General Public Licence