LCD1602 KEYPAD SHIELD

  • Tình trạng: Chỉ còn 5 sản phẩm
  • Thương hiệu: Chính hãng
64.000₫

LCD1602 KEYPAD SHIELD

LCD Keypad Shield input and output expansion board using two lines of 16 characters LCD, with contrast adjustment and backlight, the use of an analog port to complete the five key input, a reset button, the unused IO port are extended out, Make full use of IO port. Occupied digital port: PIN4 (DB4), PIN5 (DB5), PIN6 (DB6), PIN7 (DB7), PIN8 (RS), PIN9 (E), PIN10 (backlight control), analog key port A0 Used with Arduino: 

Module debugging:

Plug the LCD Keypad Shield onto the Arduino controllerand download the LCD4Bit_mod.h (right-click) library file into arduino-0015 \ hardware \ libraries, then compile the following test program and download it to Arduino for the first time LCD Keypad Shield, first observe the LCD has no display characters, if not show the characters that may be correct contrast, you can use the word screwdriver to adjust RP1 (clockwise rotation), transferred to the clear character can be.

GP2D12 Ranging Code:

#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;

 

 

Xem thêm Thu gọn

Sản phẩm vừa xem

popup

Số lượng:

Tổng tiền:

Giỏ hàng( Sản phẩm)