Reading multiple ports


Results 1 to 3 of 3

Threaded View

  1. #2
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Rob,

    I would read the entire PortB, and then do a CASE senario based on the values at the Port so that if two buttons are pressed at the same time you can detect it.

    For example:
    <table border="1" padding="3" spacing="3"><tr><td>
    B0 var byte
    TRISB = %11111111 'MAKE PORT B INPUT
    B0 = PORTB

    START:
    SELECT CASE B0

    CASE 0
    ' NO SWITCHED PRESSED
    CASE 1
    ' SWITCH ONE PRESSED
    CASE 2
    ' SWITCH TWO PRESSED
    CASE 3
    ' SWITCH'S ONE AND TWO
    CASE N
    ' WHAT EVER
    END SELECT

    GOTO START
    <br></td></tr></table>
    Last edited by Squibcakes; - 18th May 2004 at 11:34.

Similar Threads

  1. Replies: 1
    Last Post: - 29th September 2007, 18:05
  2. How to drive 7 segment using multiple ports?
    By guess79 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:43
  3. multiple ports ===> one symbol?
    By PICMAN in forum General
    Replies: 4
    Last Post: - 8th March 2005, 22:24
  4. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 16:46
  5. Reading multiple ADC channels FAST
    By lwindridge in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st April 2004, 22:37

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