Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: teensy 4.1 4x5 matrix Keypad Problem?

  1. #1
    Junior Member
    Join Date
    Sep 2020
    Posts
    15

    teensy 4.1 4x5 matrix Keypad Problem?

    I have 4x5 Matrix keypad and teensy 4.1.
    When i have connected teensy 4.1 pin connected to row 6, 5, 4, 3, 2 and column 10, 9, 8, 7 all of my keypad is working properly. But when i change the pin and wiring connection of row 37, 36, 35, 34, 33 and column 29, 30, 31 and 32 keypad is not working below is my code.
    Code:
    #include <Keypad.h>
    
    const byte ROWS = 5; //four rows
    const byte COLS = 4; //four columns
    //define the cymbols on the buttons of the keypads
    char hexaKeys[ROWS][COLS] = {
      {'0','1','2','3'},
      {'4','5','6','7'},
      {'8','9','A','B'},
      {'C','D','E','F'},
      {'G','H','I','J'}
    };
    //byte rowPins[ROWS] = {6, 5, 4, 3, 2}; //connect to the row pinouts of the keypad
    //byte colPins[COLS] = {10, 9, 8, 7}; //connect to the column pinouts of the keypad              //  Working perfectly
    
    byte rowPins[ROWS] = {37, 36, 35, 34, 33}; //connect to the row pinouts of the keypad
    byte colPins[COLS] = {29, 30, 31, 32}; //connect to the column pinouts of the keypad
    
    //initialize an instance of class NewKeypad
    Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 
    
    void setup(){
      Serial.begin(9600);
    }
      
    void loop(){
      char customKey = customKeypad.getKey();
      
      if (customKey){
        Serial.println(customKey);
      }
    }
    So please give me reply what is the problem? Is that i have to pull-up or pull-down register for keypad ?

  2. #2
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    183
    Please. Can you draw that ?

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,943
    Very odd it went from working to not working when the code looks right for the pins.

    Not sure if there is maybe a disconnected or miswired pin? Or perhaps a bad pin - or solder bridge - on the T_4.1?

    Lib has some images - likely won't anything not already done : pjrc.com/teensy/td_libs_Keypad.html

    The lib seems to take care of the pin setup with no work in setup() and PJRC shows nothing but wires to the keypad.

  4. #4
    Junior Member
    Join Date
    Sep 2020
    Posts
    15
    now every thing working fine. Thanks for your replay.

  5. #5
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    183
    what was the issue

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •