Reply to topic  [ 1 post ] 
1 x 4 Matrix Membrane Keypad (HCPROJ0005) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:02 pm
Posts: 633
Post 1 x 4 Matrix Membrane Keypad (HCPROJ0005)
Image

Description:

Membrane keypad (HCPROJ0005) in a 1 x 4 configuration. The keypad is an ultra thin design with a self adhesive backing allowing it to be easily attached to most flat surfaces. The 72mm flat ribbon cable provides access to all 4 buttons and has a standard 0.1" pitch Dupont style connector.

Specification:

Model number: HCPROJ0005
Max voltage: 50VDC
Max current: 100mA
Contact resistance: 0.5 to 10 Ohm
Min insulation resistance: 100M Ohm
Max contact bounce: 6ms
Operating temp: -20 to +40 oC
Life expectancy: 1 million closures
Connector: 9 pin Dupont 0.1" / 2.54mm pitch

Dimensions:
Image

Exclusive Arduino Sketch And Library:
Code:
/* FILE:    HCMatrixKeypad.cpp
   DATE:    14/05/14
   VERSION: 0.1
   AUTHOR:  Andrew Davies

This is an example of how to use the the HCMatrixkepday library that has been
written two work with most types of matrix keypads including keypads sold via our
own website.

The current version of library supports the following arrangement (columns x rows)
of keypads:

4 x 5 (see SKU: HCPROJ0003)
4 x 4 (see SKU: HCPROJ0001 & HCPROJ0002)
3 x 4 (see SKU: HCPROJ0004)
6 x 1 (see SKU: HCPROJ0007)
4 x 1 (see SKU: HCPROJ0005)


KEYPAD PINOUTS FOR ABOVE KEYPADS:

PIN....4x5.....4x4.....3x4.....4x1.....6x1
1......R1......C4......C3......C3........
2......R2......C3......C2......C4........
3......R3......C2......C1......C1......C6
4......R4......C1......R4......C2......C5
5......R5......R4......R3......R1......C4
6......C4......R3......R2..............C3
7......C3......R2......R1..............C2
8......C2......R1........................C1
9......C1................................R1


You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/

/* Include the HCMatrixkeypad library */
#include <HCMatrixKeypad.h>

/* Sets how many times the same key must be scanned before it is accepted as
   pressed (settled). If you get multiple key presses then increase this value
   (max 255)*/
#define DEBOUNCE 10

#define C1 2  /* DIO for keypad column 1 */
#define C2 3  /* DIO for keypad column 2 */
#define C3 4  /* DIO for keypad column 3 */
#define C4 5  /* DIO for keypad column 4. Delete if there is no column 4! */
#define C5 6  /* DIO for keypad column 5. Delete if there is no column 5! */
#define C6 7  /* DIO for keypad column 6. Delete if there is no column 6! */

#define R1 12 /* DIO for keypad row 1 */
#define R2 11 /* DIO for keypad row 2. Delete if there is no row 2! */
#define R3 10 /* DIO for keypad row 3. Delete if there is no row 3! */
#define R4 9  /* DIO for keypad row 4. Delete if there is no row 4! */
#define R5 8  /* DIO for keypad row 5. Delete if there is no row 5! */

//HCMatrixKeypad Keypad(DEBOUNCE, C1, C2, C3, C4, ROWMARKER, R1, R2, R3, R4, R5); /* Uncomment for 4x5 keypad */
//HCMatrixKeypad Keypad(DEBOUNCE, C1, C2, C3, C4, ROWMARKER, R1, R2, R3, R4); /* Uncomment for 4x4 keypad */
//HCMatrixKeypad Keypad(DEBOUNCE, C1, C2, C3, ROWMARKER, R1, R2, R3, R4); /* Uncomment for 3x4 keypad */
HCMatrixKeypad Keypad(DEBOUNCE, C1, C2, C3, C4, ROWMARKER, R1); /* Uncomment for 4x1 keypad */
//HCMatrixKeypad Keypad(DEBOUNCE, C1, C2, C3, C4, C5, C6, ROWMARKER, R1); /* Uncomment for 6x1 keypad */


void setup()
{
    Serial.begin(9600);
}

/* Main program */
void loop()
{
  /* Scans the keypad once. This line needs to be run repeatedly */
  Keypad.Scan();
 
  /* Has a new key been pressed  */
  if(Keypad.New_Key())
  {
    /* If so the send the key to the serial port */
    Serial.print("Key Pressed: Row ");
    Serial.print(Keypad.Read() / 10); /* 10's column is the keypad row number */
    Serial.print(" Col ");
    Serial.println(Keypad.Read() % 10); /* 1's column is the keypad column number */
  }
 
}


Arduino library for the above sketch can be found in the software section of our forum here:

viewtopic.php?f=43&t=1581


Fri May 23, 2014 9:45 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD