Hi

First a happy newyear, and a lot off PBP projects

As I'm a newcomer i would like to have some help from the REAL programmers

I would like to do the following with a 16F876

I have 5 AD channels with 5 variables (byte or word)
I have 5 input I/O 's (pulled up) and 5 outputs (led)s

If 1 or more inputs goes low the code has to read the representing AD converter and compare the value's
Then an output has to become High with the AD representing the highest value
Meanwhile the other's may become active or inactive

I also need some hysteresis on the comparisation:
a variable which give the minimum difference between the
AD values before the output changes, another variable which
determines the time before changes ( max a few seconds)

Can anyone set me in the right direction ?

Walter