I'd GOSUB for a complex CASE with IF statements.
You can also merge the last 2 IFs:
RobertCode:B_PWM=4095 Blue_Day_Cycle = DAY
I'd GOSUB for a complex CASE with IF statements.
You can also merge the last 2 IFs:
RobertCode:B_PWM=4095 Blue_Day_Cycle = DAY
Rob,
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.....The case statement is thus (I've removed nested IF THEN statements within the statement just in case that was causing the issue)
Is there a way to limit the word size to 12 bits rather than 16. This would then give me 4095 as the maximum rather than 65535
bitwise AND %0000111111111111
I'm shooting in the dark here but...
Is =< or => the same as <= and >= causing the the non limitations?
Louie
YourWordVariable = %0000111111111111 & YourWordVariable will limit the word size to 12 significant bits. (4 zeros and 12 ones is 4095)Is there a way to limit the word size to 12 bits rather than 16. This would then give me 4095 as the maximum rather than 65535
Last edited by towlerg; - 20th June 2014 at 18:09. Reason: old and stupid
Bookmarks