Quote Originally Posted by Demon View Post

You can also merge the last 2 IFs:
Code:
    B_PWM=4095 
    Blue_Day_Cycle = DAY
Robert
Rob,
The case statement is thus (I've removed nested IF THEN statements within the statement just in case that was causing the issue)
I had previously nested the code, but simply changed it to separate statements to rule out that as being the cause. The strange thing is it was all working when the values were all bytes and not words.....