Matrix Keypad routine


Closed Thread
Results 1 to 40 of 135

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    YUP, that's what happen when you don't check the spelling of your DEFINEs. DEFINEs are case sensitive. So PORTb have to be written PORTB, and so on with all others.
    Steve

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

  2. #2
    Join Date
    Oct 2008
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    Cheers, so any clues as to whats wrong now? i dont get any reaction on the LCD and i get several ports flash high then low

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


    Did you find this post helpful? Yes | No

    Default

    well...
    Code:
        DEFINE KEYPAD_ROW        8       ' 8 row 
        define KEYPAD_ROW_PORT   PORTc   '   on PORTB
        DEFINE KEYPAD_ROW_BIT    0       '      <7:0>
        DEFINE KEYPAD_COL        4       ' 4 col 
        DEFINE KEYPAD_COL_PORT   PORTc   '   on PORTA
        DEFINE KEYPAD_COL_BIT    0       '      <3:0>
    looking at your schematic bellow

    There's some problems there for sure... You don't use a 8X4 keypad
    Code:
        DEFINE KEYPAD_ROW		4      
        DEFINE KEYPAD_ROW_PORT   	PORTC   
        DEFINE KEYPAD_ROW_BIT	0
        
        DEFINE KEYPAD_COL        	3
        DEFINE KEYPAD_COL_PORT   PORTC
        DEFINE KEYPAD_COL_BIT    	4
    Last edited by mister_e; - 20th November 2008 at 18:58.
    Steve

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

  4. #4
    Join Date
    Oct 2008
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    Thanks yet again mister_e! You should move in with me, that way i wouldnt have to use the net to bother yo every other day

    and yes i put the dec2 myvar on the lcdout command so all works now

    time to play with it some more!

Similar Threads

  1. 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
  2. Need help in matrix keypad coding
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 24th May 2008, 13:16
  3. I2C PCF8574 4X4 Keypad routine
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th January 2007, 21:25
  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. very basic matrix keypad question
    By kitcat in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th July 2006, 21:33

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