Okay just a rough sketch of the ramping up and down is performed like this


ramping up of an LED is performed like this:

RAMPINGUP:

for Counter = 0 to 255
PortC = %00000000 'LEDS connected to PortC.0, C.1, C.2 are all off
Pauseus 255 - counter
PortC = %00000111 'LEDS are all on
Pauseus Counter

Goto RAMPINGUP

'reverse this order and you will make the LEDS ramp down

RAMPINGDOWN:

for Counter = 255 to 0 Step -1
PortC = %00000111
Pauseus Counter
PortC = %00000000
Pauseus 255 - counter

Goto RAMPINGDOWN
============================================


remember this is just a rough sketch of what I think you're trying to do. I just busted this out from atop of my head. you might need to mess around with the timing sequence depending on your design. let me know if this works. this is only one way of doing this...


srig