Arduino Keypad LCD Shield contains 16*2 LCD with contrast adjustment and backlight. LCD dispays white letters on blue background. It uses only an analog port to input the 5 keys' signal. Here is also a reset button. Still unused IO is prepared for expansion. Date port: PIN4 (DB4), 5 (DB5), 6 (DB6), 7 (DB7), 8 (RS), 9 (E), 10 (backlight control), simulation key port A0. Working with Arduino:
Connect Arduino LCD Keypad Shield with Arduino. Download "LCD4Bit_mod.h" library file and save to the "arduino-0015 hardware libraries". Compile the test program below and download to Arduino. If you use the Aduino Keypad LCD Shield for the first time and see nothing on the screen, you may need to use screwdriver to adjust RP1 which controls contrast. If clockwise rotation, characters can appear clearly. # Include LCD4Bit_mod lcd = LCD4Bit_mod (2); char GP2D12; void setup () } void loop () float read_gp2d12_range (byte pin) Description:
Pin definition:
.jpg)
Module Test :
Connecting pic :
.jpg)
GP2D12 distance measurement code:
char a, b;
char str1 [ ] = "Renge:";
char str2 [ ] = "Renge Over";
char str3 [ ] = "cm";
{
lcd.init ();
lcd.clear ();
lcd.printIn ("GP2D12 testing ...");
{
GP2D12 = read_gp2d12_range (1);
if (GP2D12> 80 | | GP2D12 <10)
{
lcd.cursorTo (2,0);
lcd.printIn (str2);
}
else
{
a = 0x30 + GP2D12/10;
b = 0x30 + GP2D12% 10;
lcd.cursorTo (2, 3);
lcd.printIn (str1);
lcd.print (a);
lcd.print (b);
lcd.printIn (str3);
}
delay (50);
}
{
int tmp;
tmp = analogRead (pin);
if (tmp <3) return -1;
return (6787.0 / ((float) tmp - 3.0)) - 4.0;
}.jpg)
Tell us what you think about this item, share your opinion with other people. Please make sure that your review focus on this item. All the reviews are moderated and will be reviewed within two business days. Inappropriate reviews will not be posted.
Have any question or inquire for this item? Please contact Customer Service. (Our customer representative will get back shortly.)