BCD to 7-segment issues


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: BCD to 7-segment issues

    Quote Originally Posted by Darrel Taylor View Post
    PORTB = (PORTB & $F0) | (MyByte & $0F)
    Wow! So simple. I played with it on paper and that works great. I did have the idea of an OR in my head, but couldn't figure out how a bit that was set to a '1' could change back to a '0'.

    Actually, now that I think of it, since MyByte is only going to be zero to nine, I think I could get away with this:

    Code:
    PORTB = (PORTB & $F0) | MyByte
    Thanks!
    Last edited by andywpg; - 9th November 2012 at 20:56.

  2. #2
    Join Date
    Feb 2013
    Posts
    1,137


    Did you find this post helpful? Yes | No

    Default Re: BCD to 7-segment issues

    It would be great, if someone with better PBP knowledge can explain, what that code actually does (how)

Similar Threads

  1. Replies: 4
    Last Post: - 2nd November 2012, 09:47
  2. Multiplexing 7-Segment
    By ross246 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th June 2011, 22:31
  3. Seven Segment LED
    By Brian in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th May 2011, 04:26
  4. interupt with 7-segment
    By freqout in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th February 2010, 09:06
  5. keypad + 7-segment
    By evmav in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th June 2006, 19:40

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