openenergymonitor / EmonLib

Electricity monitoring library - install in Arduino IDE's libraries folder then restart the IDE
openenergymonitor.org
GNU Affero General Public License v3.0
589 stars 419 forks source link

ADC readings fix #25

Closed anha1 closed 7 years ago

anha1 commented 8 years ago

Hello, please review the change proposal. Looks like it would be better to use 1023 instead of 1024 when converting ADC readings to voltage as far as 1023 is the maximum readings value.

For example, https://www.arduino.cc/en/Tutorial/ReadAnalogVoltage :

float voltage= sensorValue * (5.0 / 1023.0);