3x4 matrix keypad


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default 3x4 matrix keypad

    I have looked at the 16-key serial keypad example from Bruce's website to try and understand how to make my pic scan the keypad. I have a 12 key pad that the column are set up to connect to my 16f628a on B0-B-2 and the rows will connect to B3-B6. That leaves me with B7 set as an input and pulled 5v high with a 10k resistor. I have been trying to modify the code to work with no sucess. Does anyone have any suggestion on what I may be doing wrong. Thanks

    BTW: I am trying to insert a code block instead of just copying and paste to the forum so hopefully this works.
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Going with Bruce's code is always a good bet.

    But on this one, mister_e might have the right ticket for you.

    Variable sized keypads ...

    Matrix Keypad routine
    http://www.picbasic.co.uk/forum/showthread.php?t=3250

    DT

  3. #3

    Default

    Thanks Darrel for the reply, I finally have Bruce's code working with some modifications. I am still using portb.0-2 for my rows and portb.3-6 for my columns and portb.7 is not used so I have made it an input and pulled high via a 10k resistor. Reading my keys for what KEY value actually is in decimal, I have 1-11 buttons on this keypad, the values are 1,2,3,4,5,7,8,9,10,11,12. I don't quite understand how I missed 6 but its working good. Now for my real question, would you recommend how I may make the key being pressed continually be transmitted while I am pushing it and stop when I release the key? I have attached a text file of the code I have modified you will see under my mods Bruce's original code. Thanks again
    Attached Files Attached Files

  4. #4

    Default

    I think I figured out how, I just added an IF ((PORTB >> 3) !=1f) then send at the beginning of label getkeyu.

    Seems to be working ok momentary, now I just have to figured out how to use NAP to let the pic sleep in between button presses.

    Back to the PBP manual......

    Thank you for you suggestions.

Similar Threads

  1. Matrix Keypad routine
    By mister_e in forum Code Examples
    Replies: 134
    Last Post: - 18th September 2022, 20:30
  2. calculator-like code entry with matrix keypad and display
    By Dennis in forum mel PIC BASIC Pro
    Replies: 35
    Last Post: - 16th December 2009, 22:58
  3. Need help in matrix keypad coding
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 24th May 2008, 13:16
  4. Inconsistent output on a 4x4 matrix keypad
    By markcadcam in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 24th November 2006, 03:54
  5. 3x4 keypad picbasicpro
    By gkahraman82 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th May 2006, 21:49

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