void lcdDemoFlip(void) { char msgA[]="I Love 8051"; char msgB[]="Wow is Great!!!"; unsigned char n; lcdInit(); // Set 2 lines, font:5x7 lcdSetDisplay(LCD_DISPLAY_ON); lcdClearScreen(); lcdSetInputInc(); lcdSetInputShiftOff(); for (n=0; n<3; n++) { lcdClearRow(0); lcdSelectRow(0); lcdWriteString(msgA); lcdClearRow(1); lcdSelectRow(1); lcdWriteString(msgB); delay(DELAYLONG); lcdClearRow(0); lcdSelectRow(0); lcdWriteString(msgB); lcdClearRow(1); lcdSelectRow(1); lcdWriteString(msgA); delay(DELAYLONG); } } /* lcdDemoFlip */
void lcdDemoAnimatedChar(void) { char mario[][8]={{0x06, 0x09, 0x09, 0x06, 0x03, 0x1a, 0x05, 0x08}, {0x09, 0x09, 0x06, 0x03, 0x1a, 0x05, 0x08, 0x06}, {0x09, 0x06, 0x03, 0x1a, 0x05, 0x08, 0x06, 0x09}, {0x06, 0x03, 0x1a, 0x05, 0x08, 0x06, 0x09, 0x09}, {0x03, 0x1a, 0x05, 0x08, 0x06, 0x09, 0x09, 0x06}, {0x1a, 0x05, 0x08, 0x06, 0x09, 0x09, 0x06, 0x03}, {0x05, 0x08, 0x06, 0x09, 0x09, 0x06, 0x03, 0x1a}, {0x08, 0x06, 0x09, 0x09, 0x06, 0x03, 0x1a, 0x05}}; char msgA[]="Wow8051"; char msgB[]="Wow is Great!!!"; unsigned char n; lcdInit(); // Set 2 lines, font:5x7 lcdSetDisplay(LCD_DISPLAY_ON); // lcdMakeRawFont(0, 0x01, 0x02, 0x04, 0x08, 0x10, 0x11, 0x0a, 0x11); // lcdMakeRawFont(0, 0x04, 0x0b, 0x04, 0x07, 0x1a, 0x04, 0x08, 0x10); // lcdMakeRawFont(1, 0x06, 0x09, 0x09, 0x06, 0x03, 0x1a, 0x05, 0x08); /* Setup all 8 self-made special characters */ for (n=0; n<8; n++) { lcdMakeFont(n, mario[n]); } lcdClearScreen(); lcdSetInput(LCD_INPUT_INC); #ifdef DEBUG_USRCHAR /* try to show all 8 pre-programmed special characters */ for (n=0; n<8; n++) { lcdWriteData(n); } #endif #ifndef DEBUG_USRCHAR lcdWriteData(' '); lcdWriteData(' '); lcdWriteString(msgA); lcdSelectRow(1); lcdWriteString(msgB); for (n=0; n<8; n++) { lcdSelectRow(0); lcdWriteData(n); delay(DELAYLONG); } #endif } /* lcdDemoAnimatedChar */
void lcdInit(void) { lcdClear(); // Clear LCD Screen lcdSetDisplay(1); // Display ON, Cursor ON, Blinking ON lcdWriteCmd(0x38); // Use 8-bit, 2 Lines, Font 5x7 } /* lcdClear */
void lcdInit(void) { lcdClear(); lcdSetDisplay(1); lcdWriteCmd(0x38); } /* lcdClear */