bitwise head scratcher? Rather, pulling my hair out.


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: bitwise head scratcher? Rather, pulling my hair out.

    Along those same lines:
    Code:
    IF (OutputMap1 = 7) & (PORTB = 7) THEN
      PORTB = 0
    ELSE
      PORTB = 7
    ENDIF

  2. #2
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Thumbs up Re: bitwise head scratcher? Rather, pulling my hair out.

    Thanks for your replies guys!

    Don't I feel like an idiot! Here was my problem...

    From this:
    if PORTB & OutputMap1 = OutputMap1 then

    To this:
    if (PORTB & OutputMap1) = OutputMap1 then

    Works perfectly.

    If for nothing else, thank you guys for proding me to look at my code closer.

    Take care and be safe,
    Chris

Similar Threads

  1. Replies: 3
    Last Post: - 14th June 2012, 17:01
  2. My Head Hurts with Tables, Lookup, EXT etc etc
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th June 2012, 07:21
  3. Oh Dear. My head is spinning. HPWM RGB LEDs What to choose?
    By jimseng in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th March 2012, 17:03
  4. 3AM hair pulling again
    By muddy0409 in forum General
    Replies: 2
    Last Post: - 14th March 2009, 07:59
  5. Pulling port high
    By the_antique in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th November 2005, 18:18

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