Menu

Help with GCB/4x4 keypad

Help
lhatch
2018-06-08
2018-06-12
  • lhatch

    lhatch - 2018-06-08

    I took parts of code and made the below program. The LCD shows > 13 on the screen. Temp is 13 for some reason, and if I jumper (no keypad yet) D7 to D8 still 13 on display? Any ideas

      #chip mega328p, 16
      #include <UNO_mega328p.h>
    
      HI2CMode Master
      #define HI2C_DATA
      #define LCD_IO 10
      #define LCD_I2C_Address 0x4e       '// Change to 0xFE for SainSmart  ELSE 4E
      #define LCD_Backlight_On_State  1  '// These may need to be reversed
      #define LCD_Backlight_Off_State 0
    
      #define KEYPAD_ROW_1 DIGITAL_11
      #define KEYPAD_ROW_2 DIGITAL_10
      #define KEYPAD_ROW_3 DIGITAL_9
      #define KEYPAD_ROW_4 DIGITAL_8
      #define KEYPAD_COL_1 DIGITAL_7
      #define KEYPAD_COL_2 DIGITAL_6
      #define KEYPAD_COL_3 DIGITAL_5
      #define KEYPAD_COL_4 DIGITAL_4
    
      dim Temp as Byte
    
    ' Main
    
      Do
          'Get key
          Temp = KeypadData
          'If a key is pressed, then display it
          If Temp <> KEY_NONE Then
              cls
              print "> "
              Print Temp
             'Wait until key is released
             wait while KeypadData <> KEY_NONE
             cls
          End If
      Loop
      End
    
     

    Last edit: lhatch 2018-06-12
  • lhatch

    lhatch - 2018-06-11

    OK, another question. Anyhone have a 3x4 or 4x4 routine? None of the info mentioned pull up or down on anything, So I pulled from the examples and jumped D7 and D8

     
  • Anobium

    Anobium - 2018-06-11

    In the Help. Pull-ups or pull-downs go on the columns only, and are typically 4.7k to 10k in value.

    See if this resolves the issue.

     
  • lhatch

    lhatch - 2018-06-12

    4.7K pull-up seems to have done the trick. Thanks Will have keypads today and give the real test.

     

Log in to post a comment.