Adding code to PWM LED dimming

With (I would think) 4 states, off, dim up, on and dim down, I would probably look into Switch/Case along with the RTC @UKHeliBob mentioned.

But someone with a bit more experience may have a better way to handle it.