예제 #1
0
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 */
예제 #2
0
void lcdClearRow(unsigned char row)
{
	unsigned char n;
	unsigned char currentModeInput;
	
	currentModeInput = lcdCurrentModeInput;

	lcdSetInput(LCD_INPUT_INC);

	lcdSelectRow(row);

	for (n=0; n<40; n++)
	{
		lcdWriteData(' ');
	}

	lcdSetInput(currentModeInput);

	lcdSelectRow(row);

} /* lcdClearRow */
예제 #3
0
void main (void)
{
	lcdInit();							// Clear Screen, Display ON, Cursor ON, Blinking ON
										// Use 8-bit, 2 Lines, Font 5x7

	lcdSetInput(LCD_MODE_INPUT_INC		 |
				LCD_MODE_INPUT_SHIFT_OFF);
	
	for (;;)
	{
		lcdClearRow(0);
		delay(30000);

		lcdWriteString("I am LCD");
		delay(30000);
	}

} /* main */
예제 #4
0
void main (void)
{
	unsigned char n;

	lcdInit();							// Clear Screen, Display ON, Cursor ON, Blinking ON
										// Use 8-bit, 2 Lines, Font 5x7

	lcdSetInput(LCD_MODE_INPUT_INC |
				LCD_MODE_INPUT_SHIFT_OFF);
		
	for (;;)
	{
		for(n=0; n<0xf; n++)
		{
			lcdClearRow(1);
			lcdWriteCmd(0x80 | 0x40 | n);

			lcdWriteString("April");
			delay(10000);
		}
	}

} /* main */