I have been trying to find examples of using comparators.

Also, I detect that you can set the Vref by software. If this is possible, how do you accomplish it.

Further, how do you read the results of the comparator.

I am looking at the 12F675