Let's Make Robots!


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.