.
New Article: ESP32 online Web Remote Watch: Video
Replying to: Spark
Comment:

Hi Mikel, i replied your email. I removed variable K from the code. and x is just to run the for loop 20 times. Actually, i am taking 20 readings from the sensor and then calculating the average to get a more accurate reading. Hope it simplifies the code and you should not get negative readings.