Converting analog to digital

is the question about hysteresis?

it means that if you do

digitalWrite(outpin1, (analogRead(A0) > threshold1) ? HIGH : LOW);

then around threshold1 you'll see HIGH / LOW fluctuation because the ADC isn't perfect and a ±1 variation is frequent.

if that's a problem, then you use an hysteresis, that is if the pin is above a certain threshold you go high, but once it's HIGH you don't go back to LOW at the same threshold but something lower. (same in the opposite direction)