Pages

Tuesday 2 June 2015

8 KEYS KEYPAD

OVERVIEW

INTRODUCTION





It has 8 keys which can be connected to any microcontroller or any interfacing kit directly. KEY is a small key pad designed to data entries for microcontroller board.The board has 10-pin header for 10-wire ribbon cable. By default the switch status would be pulled up, every time you press a key the corresponding switch header changes its state to the common header in the board.



FEATURES



  • 8 keys.
  • Connect to microcontroller's pin directly.
  • 10-pin header.
  • Input pins conneceted to Burg-stick
  • On board pull-up resistors
  • High quality PCB FR4 Grade with FPT Certified.



ARUDUINO CODE
#include <LiquidCrystal.h>
LiquidCrystallcd(12, 11, 5, 4, 3, 2);

constintsw1 = 0 ;    
constintsw2 = 1;
constintsw3 = 2;
constintsw4= 3 ;
constintsw5= 4 ;
constintsw6= 5 ;
constintsw7= 6 ;
constintsw8= 7;


void setup() {

lcd.begin(16, 2);
pinMode(sw1, OUTPUT);
pinMode(sw2, OUTPUT);
pinMode(sw3, OUTPUT);
pinMode(sw4, OUTPUT);
pinMode(sw5, OUTPUT);
pinMode(sw6, OUTPUT);
pinMode(sw7, OUTPUT);
pinMode(sw8, OUTPUT);
}

void loop()
{
  if(sw1==HIGH)
  {
lcd.print("switch 1 is pressed");
  }
  else if(sw2==HIGH)
  {
lcd.print("switch 2 is pressed");
  }
  else if(sw3==HIGH)
  {

lcd.print("switch 3 is pressed");
  }
  else if(sw4==HIGH)
  {
lcd.print("switch 4 is pressed");
  }
  else if(sw5==HIGH)
  {
lcd.print("switch 5 is pressed");
  }
  else if(sw6==HIGH)
  {
lcd.print("switch 6 is pressed");
  }
  else if(sw7==HIGH)
  {
lcd.print("switch 7 is pressed");
  }
  else if(sw8==HIGH)
  {
lcd.print("switch 8 is pressed");
  }
}



2 KEYS KEYPAD                                                               4 KEYS KEYPAD