LCD 1602 Pour Arduino

LCD 1602 Pour Arduino

Features:
This is a basic 16 character by 2 line display.
Utilizes the extremely common HD44780 parallel interface chipset.
Interface code is freely available.
Blue Backlight with white words.
uses 4 Bit Arduino LCD Library.

Size:8cm x 5.9cm - 3.15inch x 2.32inch.

 
LCD Keypad Shield input and output expansion board with 2-line, 16-character LCD with contrast adjustment and backlight
Use an analog port will complete five key input, a reset button, the unused spare IO ports are extended out, take advantage of IO ports
Occupation digital ports: PIN4 (DB4), 5 (DB5), 6 (DB6), 7 (DB7), 8 (RS), 9 (E), 10 (backlight control), analog buttons port A0. Used in conjunction with the Arduino
Module debugging:
1.The LCD Keypad Shield Arduino controller plugged,Then you need to download LCD4Bit_mod.h library file to arduino-0015 \ hardware \ libraries in
2.Then compile the following test program will be downloaded to an Arduino in
3.Initial use LCD Keypad Shield, the first observation LCD has no display characters, characters may be displayed if there is no contrast is not correct, you can use the screwdriver adjust RP1 (clockwise rotation), characters can be transferred to emerge clearly.
Ranging code GP2D12:
#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;

Écrire une critique

Remarque: HTML n`est pas traduit!
    Mal           Bien
  • : 340
  • Code produit: KYLCD1602
  • Disponibilité: En stock
  • $7.99