LCD1602 KEYPAD SHIELD
- Hiển thị : 16x02 kí tự
- Nguồn cấp chip : 4.5V - 5v
- Dòng điện : 2mA (5V)
- Nguồn cấp module : 5V
- Kích thước module : 2.95x4.35mm
.
Code test :
#include <LCD4Bit_mod.h>
LCD4Bit_mod lcd = LCD4Bit_mod (2);
GP2D12 char;
char A, B;
char str1 [] = "Renge:";
char str2 [] = "Renge Over";
char Str3 [] = "cm & lt";
Void set ()
{
lcd.init ();
lcd.clear ();
lcd.printIn ("GP2D12 testing ...");
}
Loop void ()
{
GP2D12 read_gp2d12_range = (. 1);
IF (GP2D12> 80 || GP2D12 <10)
{
lcd.cursorTo (2,0);
lcd.printIn (str2);
}
the else
{
A = 0x30 + GP2D12 / 10 ;
B = 0x30 + 10% GP2D12;
lcd.cursorTo (2,. 3);
lcd.printIn (str1);
lcd.print (A);
lcd.print (B);
lcd.printIn (Str3);
}
Delay (50 );
}
read_gp2d12_range a float (byte PIN)
{
int tmp;
tmp = analogRead (PIN);
IF (tmp<3) return -1;
return (6787.0/ ((a float) tmp - 3.0)) - 4.0;