Thanks again. One very last question, since I got it almost worked out, how can I invert the output signal?
Let me explain. In my configuration, instead of R1 I have a reflective optical sensor CNY70. The sensor puts out approx. 0 voltage unless I obscure it, in which case the voltage increases.
So in the beginning, the LM339 has an ouput that is HIGH, because the CNY70's 0 volts are below the reference voltage (set by R2 & R4, or in my configuration, a trimpot). When I obscure the sensor, its voltage increases until it passes the reference voltage threshold and the LM339 changes its output from HIGH to LOW.
I need it to be reversed, I need the output to read HIGH, once the CNY70 increases the voltage past the threshold.
I've tried to invert the pins (non-inverting and inverting), but to no avail...because the Schmitt trigger fails.