You're comparing two analog values, which could fluctuate by some units. If the test is done "fast", you can have flickering.In fact your 1s delay between each run prevents this from happening even if you haven't any hysteresis
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16