Product Details

Description:

Can be inserted directly into Arduino uno mega2560,Ideal for linking up to your Arduino UNO Mini Nano Mega2560 Breadboard etc,or others MCU ( AVR STM32 ARM PIC AT89C51 STC MSP430 STM8 FPGA CPLD etc.)

1 4-button Common Cathode key module .
2 " GND K1 K2 K3 K4" 4 PIN OUT 2.54mm
3 Size: 12.7MM x 33MM.
 
Circuit schematics : 
 
Arduino uno/mega2560 Code
//******************************************************//
/*
Arduino_4key_uart
This example code is in the public domain.
*/
// Define key pin
int K1 = 13;
int K2 = 12;
int K3 = 11;
int K4 = 10;

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

// the setup routine runs once when you press reset:
void setup() {

// initialize the keys pin as an input.
pinMode(K1, INPUT);
pinMode(K2, INPUT);
pinMode(K3, INPUT);
pinMode(K4, INPUT);

//Activate key pin internal pull-up resistors
digitalWrite(K1, HIGH);
digitalWrite(K2, HIGH);
digitalWrite(K3, HIGH);
digitalWrite(K4, HIGH);

// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {

buttonState = digitalRead(K1);
if(!buttonState)Serial.print("k1 \n" );
do
{
buttonState = digitalRead(K1);
}
while(!buttonState);//Wait button release

buttonState = digitalRead(K2);
if(!buttonState)Serial.print("k2 \n" );
do
{
buttonState = digitalRead(K2);
}
while(!buttonState);//Wait button release
buttonState = digitalRead(K3);
if(!buttonState)Serial.print("k3 \n" );
do
{
buttonState = digitalRead(K3);
}
while(!buttonState);//Wait button release

buttonState = digitalRead(K4);
if(!buttonState)Serial.print("k4 \n" );
do
{
buttonState = digitalRead(K4);
}
while(!buttonState);//Wait button release
delay(100);
}
//******************************************************//
 
Package include:
1* 4 Keys Button Keypad Keyboard Module for Arduino DIY
  • EBAY Managed Payment. But we only Accept your Ebay Address, please Make sure it's 100% right.
  • Payment must be received in 5 business days of auction closing.
  • Please leave note for your special request (e.g. Colors or Size) in PayPal when you pay the order.
  • Any special request cannot be accepted after 24 hours of payment, because most of orders will be processed instantly and same day dispatched.

1. We only ship to the confirmed address provided by eBay. please make sure your ebay address is 100% matches the address you would like us to ship to. If not, please let us know before we sent you the package, or we will not be responsible for any loss. hope you could understand.
2. Orders will be processed instantly and dispatched within 1-3 business days except hoilday, so we do NOT accept any email/message note after you place orders.
3. All package need to wait 30 days,Please take care it.Less than 30 days,we can't take a refund.

  • All package need to wait 30 days(US only need 7-10 days),Please take care it.Less than 30 days,we can't take a refund.
  • If the item is defect when you receive it or you are not satisfied with it, please return it within 14 days for a replacement or money back. But the items must be back in factory condition. Please keep in touch with us and double check the return address before you return it.
  • If is item is defective in 12 months, you can return it to us. We will send you a new replacement after receiving the defective item.

    We maintain high standards of excellence and strive for 100% customer satisfaction! Feedback is very important to us. We request that you keep in touch with us immediately BEFORE you give us neutral or negative feedback, so that we can satisfactorily address your concerns.

DataCaciques