Data Sheet

UCTRONICS Ultimate Starter Leaning Kit for Raspberry Pi #K0064
86 www.uctronics.com
register. The wiringPiDev Library simplifies this for you, so you don't need to know the
low-level instructions.
The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit
mode requires six I/O pins from the Raspberry Pi, while the 8-bit mode requires 10pins. For
displaying text on the screen, you can do most everything in 4-bit mode, so example shows
how to control a 2x16 LCD in 4-bit mode.
A potentiometer, informally a pot, is a three-terminal resistor with a sliding or rotating
contact that forms an adjustable voltage divider. If only two terminals are used, one end and
the wiper, it acts as a variable resistor or rheostat.
3. Key function
int lcdInit (int rows, int cols, int bits, int rs, int strb, int d0, int d1, int d2, int d3, int d4, int
d5, int d6, int d7)
This is the main initialisation function and must be called before you use any other LCD
functions. Rows and cols are the rows and columns on the display (e.g. 2, 16 or 4,20). Bits is
the number of bits wide on the interface (4 or 8). The rs and strb represent the pin numbers
of the displays RS pin and Strobe (E) pin. The parameters d0 through d7 are the pin numbers
of the 8 data pins connected from the Pi to the display. Only the first 4 are used if you are
running the display in 4-bit mode. The return value is the
handle
to be used for all
subsequent calls to the lcd library when dealing with that LCD, or -1 to indicate a fault.
(Usually incorrect parameters)
lcdPosition (int handle, int x, int y)
Set the position of the cursor for subsequent text entry. x is the column and 0 is the left-most
edge. y is the line and 0 is the top line.
lcdPuts (int handle, const char xstring)
lcdPrintf (int handle, const char xmessage, )
lcdPutchar (int handle, unsigned char data)
These output a single ASCII character, a string or a formatted string using the usual printf
formatting commands.