Code
Code
h>
// LCD definitions
#define LCD_DATA P2
// SW pin
#define SW P1_0
// Function prototypes
void initLCD();
void clearLCD();
void main() {
initLCD();
while (1) {
// Read SW pin
clearLCD();
setCursor(0, 0);
if (swStatus) {
clearLCD();
void initLCD() {
LCD_EN = 0;
unsigned char i = 0;
sendData(string[i]);
i++;
void clearLCD() {
if (row == 0)
else
sendCommand(address);