row -> col and col -> row


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by savnik View Post
    I swap col with row with no succes
    Maybe do a search on 'matrix keypad'

  2. #2


    Did you find this post helpful? Yes | No

    Default

    This is how I read a 16 matrix membrane switch. All horizonal rows connected to PORTC 1,2,3,4 outputs. All vertical columns connected to PORTB 1,2,3,4 inputs held high by resistor network. This example just shows eight readings:

    PORTC = 255 'MAKE SURE ALL OUTPUTS ARE HIGH

    START:
    LOW PORTC.1
    PAUSE 1
    IF PORTB.1 = 0 THEN ONE
    IF PORTB.2 = 0 THEN TWO
    IF PORTB.3 = 0 THEN THREE
    IF PORTB.4 = 0 THEN FOUR
    HIGH PORTC.1
    PAUSE 1

    LOW PORTC.2
    PAUSE 1
    IF PORTB.1 = 0 THEN FIVE
    IF PORTB.2 = 0 THEN SIX
    IF PORTB.3 = 0 THEN SEVEN
    IF PORTB.4 = 0 THEN EIGHT
    HIGH PORTC.2

    Pauses are added to slow down the process. Without them we experienced intermittant problems (probably from capacitance in the membrane switch). Hope this helps.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. keypad 4x3
    By jonas2 in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 15th July 2009, 06:34
  2. problem with my code
    By civicgundam in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd February 2008, 01:52
  3. cant get my Lcd to work using Pic18f452
    By civicgundam in forum General
    Replies: 13
    Last Post: - 7th October 2007, 00:13

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