• Indonesia
  • English
Login

Selamat Datang, Terus Belanja dan dapatkan berbagai promo menarik di toko kami

1602 LCD Keypad Characters Display Shield With Arudino LCD4Bit library For Arduino Board

Beli Produk

30

Tersedia

Description:
This is a 16x2 LCD Keypad module for ARDUINOBlue Backlight with white words
Uses 4 Bit Arduino LCD Library
100% brand new and high quality
The Modified LCD4Bit library and Schematic will send by email.
GP2D12 ranging 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;