User Manual

114
Note: After you run the code, characters may not appear on the LCD1602. You need
to adjust the contrast of the screen (the gradual change from black to white) by
spinning the potentiometer clockwise or anticlockwise, until the screen displays
characters clearly.
For C language users:
Step 2: Get into the folder of code
cd /home/pi/SunFounder_Super_Kit_V3.0_for_Raspberry_Pi/C
Step 3: Compile
make 16_lcd1602
Step 4: Run
sudo ./16_lcd1602
Code Explanation
#include <lcd.h> // includes the lcd library, containing some functions for the LCD1602
display for convenient use
const unsigned char Buf[] = "---SUNFOUNDER---"; // An array to store the characters to
be displayed on the LCD1602
const unsigned char myBuf[] = " sunfounder.com"; // Another array to store the
characters
fd = lcdInit(2,16,4, 2,3, 6,5,4,1,0,0,0,0); // Initialize the LCD display, see
/usr/local/include/lcd.h
// lcdInit(rows, cols, bits, rs, strb, d0, d1, d2, d3, d4, d5, d6, d7) - LCD1602 shows
2 rows and 16 columns. If the initialization succeeds, it will return True.
lcdClear(fd) // Clear the screen
SunFounder