rbaron / b-parasite

🌱💧 An open source DIY soil moisture sensor
1.85k stars 143 forks source link

Only read positive voltages in adc.c #180

Closed jhbruhn closed 4 months ago

jhbruhn commented 4 months ago

The ADC sometimes responds with negative voltages read on the ADC input due to noise. This can lead to very high illuminance readings at night (4095 << 4 to be exact due to two's complement :) ). This commit caps ADC readings at 0.

rbaron commented 4 months ago

Thanks once again @jhbruhn.