A 16×2 character LCD can display 16 characters and have two lines, a total of 32 characters can be displayed at a time. LCD is controlled by display controller which determines its features. Most common display controller is Hitachi HD44780.
To know more about pin layout, read this article.
There are three sample codes,
Download this set from below or browse the code on GitHub.