DFR LCD Keypad Shield
![]() Click to enlarge |
|
Arduino input and output expansion board LCDKeypad Shield
Warna LCD biru dengan backlight putih
LCD Keypad Shield O expansion board with 2 lines of 16 character LCD with adjustable contrast and backlight, using an analog port will complete the five key input, a reset button, do not use extensions of the IO ports are alternate, full use of the IO port. Take digital port: PIN4 (DB4), 5 (DB5), 6 (DB6), 7 (DB7), 8 (RS), 9 (E), 10 (backlight control), analog key port A0 . (LCD color is not specified, the random delivery.) used in conjunction with Roboduino:
Module debug: Plugged into the LCD Keypad Shield Arduino controller, and then need to download LCD4Bit_mod.h (Save as) library file to arduino-0015 \ hardware \ libraries in, then compile the following test program will be downloaded to a Arduino, the first Use LCD Keypad Shield, the first observation of the character LCD has no display, if the character does not show that the contrast may be incorrect, you can use a flathead screwdriver adjust RP1 (clockwise rotation), the character can be transferred to appear clearly. Professional anti-static packaging
Test renderings:
GP2D12 distance code:
# Include <LCD4Bit_mod.h>
LCD4Bit_mod lcd = LCD4Bit_mod (2);
char GP2D12;
char a, b;
char str1 [] = "Renge:";
char str2 [] = "Renge Over";
char str3 [] = "cm";
void Setup ()
{
lcd.init ();
lcd.clear ();
lcd.printIn ("GP2D12 testing ...");
}
void loop ()
{
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 );
}
float read_gp2d12_range (byte pin)
{
int tmp;
tmp = analogRead (pin);
if (tmp <3) return -1;
return (6787.0 / ((float) tmp - 3.0)) - 4.0;
}
Your Review: Note: HTML is not translated!
Rating: Bad Good
Enter the code in the box below: