The series of LCD Basic Project 1602, and Programs

                LCD to compose, all you need is some jumper cables and a potentiometer. The potentiometer serves to adjust the contrast of the LCD backlight. Consider the circuit below.

1602 LCD connects to an Arduino

1602 LCD connects to an Arduino


  1. Pin V0 LCD potentiometer connected to the middle leg, while each leg on the edge of the potentiometer is connected to VCC and GND. If you later see less clear writing, please turn-turn potentiometer her.
  2. Pin R / W on the LCD is connected to GND
  3. Pin RS on the LCD is connected to pin 6 on Arduin
  4. Pin E on the LCD is connected to pin 7 on Arduino
  5. Pin to the data (D4 - D7) on the LCD is connected to pin 9 -12 on Arduino
  6. VDD and A on the LCD connected to + 5v
  7. VSS and K on the LCD is connected to GND


// Free Tutorial Arduino
// www.ioisalman.com


#include 

// Setting LCD RS E D4 D5 D6 D7
LiquidCrystal lcd (7, 6, 9, 10, 11, 12);

void setup () {
   // Select LCD 16 x 2
   lcd.begin (16.2);
   lcd.print ("WWW.IOISALMAN.COM");
}

int count = 0;
void loop () {
   // Move to the column line 1 to line 2
   // Array always starts from 0
   lcd.setCursor (0.1);
   lcd.print (count ++);
   delay (1000);
}

               In Arduino we could use the library to write LCD. The library is LiquidCrystal.h. To use the library you can either include her as the 8th row.

// Setting LCD RS E D4 D5 D6 D7
LiquidCrystal lcd (7, 6, 9, 10, 11, 12);



               Command on line 8 is for setting the LCD according to the library is used. Lcd function () is an instance of a class that dipanggila LiquidCrystal on row 8 has a parameter row pin RS, E, D4, D5, D6 and D7. If you want to use a more formal, then you can use some parameter selection as below:


LiquidCrystal(RS, E, D0, D1, D2, D3); LiquidCrystal(RS, RW, E, D0, D1, D2, D3); LiquidCrystal(RS, E, D0, D1, D2, D3, D4, D5, D6, D7); LiquidCrystal(RS, RW, E, D0, D1, D2, D3, D4, D5, D6, D7); 


               Then consider the line of the 12th


// Select LCD 16 x 2
lcd.begin (16.2);


               The function begin (column, row, charsize) has two mandatory parameters and 1 additional parameter. Mandatory parameter is the column information and the information line on the LCD. While the additional information is charsize for each character to be used. By default, charsize sized 5x8 pixel for each character, if you have an LCD with a pixel different, please disesuaikan.Fungsi begin () is also used to initialize the LCD type that will be used. Perhaps this is somewhat similar to Serial.begin () function to initialize the serial communication parameters such as baud rate to be used.


// Move to the column line 1 to line 2
   // Array always starts from 0
   lcd.setCursor (0.1);
   lcd.print (count ++);



               SetCursor function (column, row) is used to move the cursor active with columns and rows that we set. Column-0 means that the column to 1 on the LCD (remember, the first number in the array is 0, not 1), whereas line 1 means is row 2 on the LCD.

               In row 21, why use print () instead of System.out.println ()? The use System.out.println () in the LCD will automatically add 2 extra newline characters (CR and LF), then if you use System.out.println (), will appear two strange characters on the LCD. So, use print () to write to the LCD.

Subscribe to receive free email updates:

0 Response to "The series of LCD Basic Project 1602, and Programs"

Post a Comment