Uber noob needs clarity!


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I think this is what you are looking for. In the manual under "Ports and other Registers".

    Code:
    anyvar = PORTB & $0f   'Isolate lower 4 bits of PORTB and place result into anyvar
    $0f = 00001111
    $00ff = 11111111

    Now you can check "anyvar" for changes.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Apr 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Thanks a bunch man!

    Thanks everyone...

    These are some really good idea's. I had to "walk away" for awhile. I will read Melanie's post(man she is a wealth of knowledge....Bet she was born with a PBP manual in her hand!), try a few things. and get back with you all tonight.

    Thanks for the tips.

    Bill12780

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    This will work;
    Code:
    X VAR BYTE
    
    main:
      for X = 0 to 7
          if PortB.0[X] = 1 then xxxxx
      next X
      goto main
    PortB.0 <-- zero after PortB indicates you're dealing with a bit.

    PortB.0[X] <-- [X] = the bit index pointer.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Apr 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default bruce is the man!

    "PortB.0 <-- zero after PortB indicates you're dealing with a bit.

    PortB.0[X] <-- [X] = the bit index pointer."


    Thanks bruce that is a brilliant little tidbit of information (for a noob like me)that I probly glazed over in the manual 20 times and it never stuck..

    Thanks! I knew it could be done like that...Just not smart enought to figure out how! hahha

    thanks again!
    Bill12780
    Last edited by bill12780; - 23rd July 2007 at 21:43.

Similar Threads

  1. NOOB in need of help
    By studysession in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th January 2009, 23:01
  2. Replies: 2
    Last Post: - 7th March 2008, 02:16
  3. Help a noob out?
    By yasiryassin in forum mel PIC BASIC
    Replies: 2
    Last Post: - 15th January 2008, 06:37
  4. Crystals & Caps - Super noob question??
    By kevj in forum General
    Replies: 4
    Last Post: - 24th September 2007, 17:11

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