This is not important as the code works as is with this hardware but should be corrected anyway.
The function calc_rms(int pin, int samples) receives the pin number for the readings, but all the readings are made in pin 0 and the variable isn't used.
Cheers.
Re: emonPi_Startup.ino calc_rms BUG
Well spotted - I'll point Glyn towards this.
Re: emonPi_Startup.ino calc_rms BUG
Thanks, I've made the fix. Well spotted, would no doubt have caused confusion in the future! Is that what you meant: https://github.com/openenergymonitor/emonpi/commit/555f4784a06e4daa576611193cd16fd0c43671f8
Re: emonPi_Startup.ino calc_rms BUG
Hi,
Don't seem right as is
Made correction:
+ int raw = (pin-512);
Correct correction:
+ int raw = (analogRead(pin)-512);
Cheers.
Re: emonPi_Startup.ino calc_rms BUG
Woops, yes indeed https://github.com/openenergymonitor/emonpi/commit/cf67c91be4be581b1cf90390522318c2606fc72b
Thanks,