コード例 #1
0
void APP_init()
{
	/* Initialize LCD Driver */
	LCD_init();
	LCD_clear(); /*clear LCD at the beginning */
	LCD_sendString("Temp = ");
	LCD_goToRowColumn(0,10);
	LCD_sendData('C');
	SENSOR_init();
}
コード例 #2
0
void APP_start()
{
	uint8 temp;
	while (1)
	{
		temp = SENSOR_read(0);
		LCD_goToRowColumn(0,7);
		LCD_intgerToString(temp); /*display the temp on LCD screen */
	}
		
}
void getPassword(uint8 array[])
{
	sint8 i;
	uint8 key;
	for (i = 0; i < 5; i++)
	{
		key = KeyPad_getPressedKey();
		if (key == '*')
		{
			LCD_displayStringRowColumn(1, 0, "                ");
			i = -1;
			continue;
		}
		else if ((key >= 0) && (key <= 9))
		{
			array[i] = key;
		}
		else
		{
			i -= 1;
			continue;
		}
		_delay_ms(BUTTON_DELAY);
		LCD_goToRowColumn(1, i + 3);
		LCD_displayCharacter('*');

		if (i == 4)
		{
			key = KeyPad_getPressedKey();
			if (key == 13)
			{
				break;
			}
			else if (key == '*')
			{
				LCD_displayStringRowColumn(1, 0, "                ");
				i = -1;
				continue;
			}
		}
	}

}