3x4 keypad picbasicpro 2


Closed Thread
Results 1 to 5 of 5
  1. #1
    gkahraman82's Avatar
    gkahraman82 Guest

    Default 3x4 keypad picbasicpro 2

    And also does anybody know 3x4 keypad picbasic code?

  2. #2
    Join Date
    Mar 2005
    Posts
    5


    Did you find this post helpful? Yes | No

    Default 4X4 keyboard

    Follow this link:http://www.rentron.com/PicBasic1.htm

    I used the 4X4 keybord succesfully several times.
    greetings,
    Paul

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


    Did you find this post helpful? Yes | No

    Default

    Another way,
    http://www.picbasic.co.uk/forum/showthread.php?t=3250
    allow you to use the keypad format you want. 3x4,3x5,6x8,8x8 .....
    Steve

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

  4. #4
    gkahraman82's Avatar
    gkahraman82 Guest


    Did you find this post helpful? Yes | No

    Default 3x4 ???

    can you convert this programme to 3x4 kaypad programme?????



    1st column - RB0
    2nd column - RB1
    3rd column - RB2
    1st row - RB3
    2nd row - RB4
    3rd row - RB5
    4th row - RB6


    DEFINE LOADER_USED 1
    i VAR byte
    col VAR byte
    row VAR byte
    num VAR byte
    PIN VAR byte[4]
    ADMIN VAR byte[4]
    GREEN VAR PORTA.2
    YELLOW VAR PORTA.1
    BUZZER VAR PORTA.3
    OPTION_REG.7 = 0
    DATA 0,..............??????? I don't know how to write this part!!!

    SETPIN:
    SETPIN:
    i = 0 WHILE i<4 PIN = 0 GOSUB KEYPAD LET PIN = num i = i + 1
    WEND

    CHKAMD:
    WRITE 1, PIN
    PAUSE 200
    READ 0, ADMIN
    PAUSE 200
    IF PIN4 = ADMIN THEN
    GREEN = 1
    END
    ELSE
    GOTO SETPIN
    ENDIF
    KEYPAD:
    PAUSE 50

    NO_KEY:
    TRISB = %01111000
    PORTB = 0
    IF ((PORTB >> 3)!= %1111)THEN GOTO NO_KEY
    PAUSE 50

    GOTKEY:
    FOR col = 0 to 2
    row = 0 TRISB = (dcd col)^%11111111
    PORTB = 1
    row = PORTB>>3
    IF (row!= %1111)THEN CAL_NUM
    NEXT col
    GOTO GOTKEY

    CAL_NUM:
    YELLOW = 1
    SOUND BUZZER,[100,10]
    PAUSE 500
    YELLOW = 0
    num = (col*3) + (ncd (row^$F))
    RETURN

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


    Did you find this post helpful? Yes | No

    Default

    Using the link i provided and using MPASM to compile you need...
    Code:
    INCLUDE "KeyPad.bas"
    
    DEFINE KEYPAD_ROW        4        ' 4 ROW keypad       
    DEFINE KEYPAD_ROW_PORT   PORTB    ' ROW port = PORTB
    DEFINE KEYPAD_ROW_BIT    3        ' ROW0 = PORTB.3
    DEFINE KEYPAD_COL        3        ' 3 COL keypad
    DEFINE KEYPAD_COL_PORT   PORTB    ' COL port = PORTB
    DEFINE KEYPAD_COL_BIT    0        ' COL0 = PORTB.0
    
    YourVar                  var byte
    
    Start:
        @ READKEYPAD _YourVar
        ' plah plah
        '      plah plah
        '           plah plah
        '
    and your keypad results will be stor in YourVar variable as follow
    Code:
    col0  col1  col2
      1     2     3   row0
      4     5     6   row1
      7     8     9   row2
     10    11    12   row3
    Last edited by mister_e; - 31st May 2006 at 00:20.
    Steve

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

Similar Threads

  1. 4x4 keypad Help
    By aaliyah1 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th October 2010, 16:34
  2. 3x4 matrix keypad
    By tazntex in forum Serial
    Replies: 3
    Last Post: - 14th October 2008, 20:13
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. 3x4 keypad picbasicpro
    By gkahraman82 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th May 2006, 21:49
  5. 3x4 keypad scanning problem and others
    By pt3rg in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd December 2003, 02:21

Members who have read this thread : 1

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