The cmcon tells it whether to turn on or off the comparators on chip.Which must be done on the channel you are using for your A/D conversion(turn it off that is)so include that in your code up top(find the register and the code for the channel(s) you're using,in the data sheet).You could also use a comparator on the chip for your function,but it is not as resolved as the A/D but in this case I think you could find a place that could suffice for 'tripping' the comparator between day and night.
When you say "it doesn't like it" you mean you get a 'syntax' error?
Bookmarks