Merge of the interrupt pulse sketch and the Discrete Sample sketch, see here:
http://openenergymonitor.org/emon/node/5022#comment-20985
Thanks to Robert Wall