before you start programming on LCD with your arduino board , I highly recommend you to learn basic of LCD working principle and its inside instruction in this link of AVR section .There I have explained clearly about every thing you need to know about liquid crystal display and how it works .
Now connect your hardware according to the circuit diagram shown above (make sure pin number 1 of LCD should connected to ground, pin no 2 is used to control brightness and pin number 3 is +5 volt) and go to liquid crystal example as shown in figure below
the code look like this
first of all we have initialize the display with function LiquidCrystal lcd(12, 11, 5, 4, 3, 2); this function determine which pins are to be used . Here 12,11,5,4,3,2 of arduino pins are used first two number 12,11 are used to define enable and reset pin of LCD shown in ckt above and rest of pins 5,4,3,2 are used for data you can change these pins according to your circuit but make sure first two pins are for enable and RS and others are for data .
Now after this define your LCD types using lcd.begin(16, 2); function in our case 16x2 alphanumeric lcd is used .because there are different types of LCDs availabe in market like 16x4 etc .And then finally print your message using function lcd.print("hello, world!"); which display message to your LCD . There are different types of function declared and defined for LCDs for arduino . You can learn detail about those functions in arduino official website https://www.arduino.cc/en/Reference/LiquidCrystal .
sorry , i have not included all those functions detail here but after you learned those functions please return here i have easy method of learning arduino for you.
- getting started with blinky
- different methods of programming
- LED array (display eight LEDs serially)
- Display message on liquid crystal display(LCD)
section-4. introduction to functions and library
section-5. input and output
section-6. sensors and transducers
section-7. motors and relay interfacing
section-8. Liquid crystal display(LCD) interfacing
section-9.seven segments interfacing
section-10.timer and counters
section-12.pulse width modulations (PWM)
section-14.using ethernet shield