Welcome Guest [Login|Register]
Language
Currency
Shop by Category
Shopping Cart
Your shopping cart is empty.
0Items in cart:
0.0g / 0.00ozShipping Weight:
C$0.00Total:

Siglent products lineup is currently being updated. For pricing and availability please see Siglent America website or request information via email

Keypad Shield 16x2 LCD 1602 for Arduino White Text on Blue Backlight

Location: /Miscellaneous

Keypad Shield 16x2 LCD 1602 for Arduino White Text on Blue Backlight

Click image to zoom.

Shown images are ilustrative only. Please refer to manufacturer's website and/or available datasheet for accurate information.

QtyUnit PriceLot Price
1C$12.4700C$12.47
2C$10.4800C$20.96
5C$8.5130C$42.56
10C$6.4620C$64.62
Stock:46 ships today
If ordered and paid before noon EST
Canada ships daily from ON, USA 2x/wk from NY

Uses 4-bit Arduino library.

Product Information
dipmicro Code DE3979
Added 2012-06-14
Manufacturer BTELEC
Stock Type New
Restockable? No
Shipping Weight 60g / 2.12oz
Ship Cost Canada CP Expedited Parcel C$10
Ship Cost USA USPS First Class $4
Ship Cost World Economy C$5.00
 
Technical Summary
Packaging bulk

Features

  • 16x2 blue backlight LCD display
  • 6x Momentary push buttons
  • Arduino compatible shield
  • Fully assembled and tested
  • White text, blue backlight
  • Precision adjustable contrast

Example Arduino Sketch

/*
  The circuit:
 * LCD RS pin to digital pin 8
 * LCD Enable pin to digital pin 9
 * LCD D4 pin to digital pin 4
 * LCD D5 pin to digital pin 5
 * LCD D6 pin to digital pin 6
 * LCD D7 pin to digital pin 7
 * LCD BL pin to digital pin 10
 * KEY pin to analogl pin 0
 */

#include <LiquidCrystal.h>

LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);

char msgs[5][16] = {
  "Right Key OK ",
  "Up Key OK    ",               
  "Down Key OK  ",
  "Left Key OK  ",
  "Select Key OK" };

int adc_key_val[5] = {50, 200, 400, 600, 800 };
int NUM_KEYS = 5;
int adc_key_in;
int key = -1;
int oldkey = -1;

void setup()
{
  lcd.clear(); 
  lcd.begin(16, 2);
  lcd.setCursor(0,0); 
  lcd.print("Shield key test:"); 
}

void loop()
{
  adc_key_in = analogRead(0);      // read the value from the sensor 
  key = get_key(adc_key_in);       // convert into key press
 
  if (key != oldkey) {             // if keypress is detected
    delay(50);                     // wait for debounce time
    adc_key_in = analogRead(0);    // read the value from the sensor 
    key = get_key(adc_key_in);     // convert into key press
    if (key != oldkey) {   
      lcd.setCursor(0, 1);
      oldkey = key;
      if (key >=0) {
           lcd.print(msgs[key]);              
      }
    }
  }

  delay(100);
}

// Convert ADC value to key number
int get_key(unsigned int input)
{
    int k;
   
    for (k = 0; k < NUM_KEYS; k++) {
      if (input < adc_key_val[k])
        return k;
    }
   
    if (k >= NUM_KEYS)             // No valid key pressed
      k = -1;

    return k;
}