Comparator circuit question

I have been playing around with BEAM robotics and I have found answers to a lot of my questions but this one still persists. Why does there have to be a pull-up resistor? Can`t I interpret the signal without it? My first guess is that if Vin is smaller than Vref then V+ at the top of the pull-up circuit will be grounded through the op-amp so that Vo is grounded as well. In the other case, electricity flows through Vo and I can use the signal to activate a transistor. Just a guess so I'm pretty sure it's not right and it bugs me when I use a circuit I don't understand in one of my robots because I feel like I'm plagiating someone's work instead of actually designing something myself. 

Had to dig through the

Had to dig through the datasheet a bit to find this one:

"The output of the LM139 series is the uncommited collector of a grounded-emitter NPN output transistor."

This means that the output can only drive low - it needs the pull-up to make the output go high again. In some circuits you wouldn’t need the pull-up at all, for example if you were driving the base of a PNP transistor.

The advantage of this is that the LM139 IC can run from something like a 3V supply, but if you connect the pull-up to a 12V source your LM139 output will swing from 0V to 12V. Very convenient for switching between different voltage levels in the same circuit.

Errrr actually I’m planning

Errrr actually I’m planning on using this : http://www.solarbotics.com/products/lm393/resources/. Now I will re-read the information you said a bunch of times to understand. Yes I am that slow XD!

The LM393 has the same type

The LM393 has the same type of output as the LM139, so everything in the above post still applies =)

Actually I simply want to

Actually I simply want to compare the values of 2 phototransistors and choose the biggest one. One chip will act as a NOT logic gate because I will be feeding the same values but invert the + and - for that comparator so that I can feed the values directly to an H-Bridge (PNP or NPN I still haven’t decided).

**Yay! Thanks a lot **

Yay! Thanks a lot