Added support for ADCs with other than 10 bir resolution, by adding a optional paramter adcBits to constructor.
The constructor updates a member variable _adcMax to 2^adcBits-1.
Subsequent calculations are now using this variable instead of constants 1023/1024 (which are only correct for 10bit ADCs).
The addition of the optional parameter legacy code will not be affected by the change.
Added support for ADCs with other than 10 bir resolution, by adding a optional paramter
adcBits
to constructor. The constructor updates a member variable_adcMax
to2^adcBits-1
. Subsequent calculations are now using this variable instead of constants 1023/1024 (which are only correct for 10bit ADCs).The addition of the optional parameter legacy code will not be affected by the change.