Conditions not being met - what's going on


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: Conditions not being met - what's going on

    I'd GOSUB for a complex CASE with IF statements.

    You can also merge the last 2 IFs:
    Code:
        B_PWM=4095 
        Blue_Day_Cycle = DAY
    Robert

  2. #2
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Conditions not being met - what's going on

    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.....

  3. #3
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Conditions not being met - what's going on

    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

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Conditions not being met - what's going on

    bitwise AND %0000111111111111

  5. #5
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Conditions not being met - what's going on

    Quote Originally Posted by towlerg View Post
    bitwise AND %0000111111111111
    Sorry, could you please elaborate and apply that to the variable ?

  6. #6
    Join Date
    Nov 2007
    Location
    West Covina, CA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: Conditions not being met - what's going on

    I'm shooting in the dark here but...
    Is =< or => the same as <= and >= causing the the non limitations?
    Louie

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: Conditions not being met - what's going on

    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
    YourWordVariable = %0000111111111111 & YourWordVariable will limit the word size to 12 significant bits. (4 zeros and 12 ones is 4095)
    Last edited by towlerg; - 20th June 2014 at 18:09. Reason: old and stupid

Similar Threads

  1. Matching time conditions
    By malc-c in forum mel PIC BASIC Pro
    Replies: 48
    Last Post: - 13th April 2010, 20:22
  2. 16LF88 conditions
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th March 2009, 07:56

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts