示例#1
0
文件: Lcd.c 项目: gnbl/OpenZero
/// \brief .
/// 
/// 
void LCD_writeText( unsigned char *text )
{
	Lcd_Symbol( DOT, 0 );
	Lcd_Symbol( COLON, 0 );
	for( int i = 0; i<LCD_MAX_CHARS; i++ )
	{
		Lcd_Map(i,*(text+i));
	}
}
示例#2
0
文件: Lcd.c 项目: gnbl/OpenZero
/// \brief .
/// 
/// 
void LCD_showTime( void )
{
	Lcd_Symbol( DOT, 0 );
	Lcd_Symbol( COLON, 1 );
	
	Lcd_Map(0,'0'+(rtc.hour/10)%10);
	Lcd_Map(1,'0'+rtc.hour%10);
	Lcd_Map(2,'0'+(rtc.minute/10)%10);
	Lcd_Map(3,'0'+rtc.minute%10);
}
示例#3
0
void Lcd_SymbolsOff( void )
{
	for( unsigned char i = 0; i<MAXSYMBOLS; i++ )
	{
		Lcd_Symbol( i, 0 );
	}		
}
示例#4
0
文件: Lcd.c 项目: gnbl/OpenZero
/// \brief Display integer up to four digits, right aligned, leading spaces.
/// 
/// Supports negative numbers, but only shows last three digits because of the '-' sign.
void LCD_writeNum( int16_t num )
{
	// clear symbols
	Lcd_Symbol( DOT, 0 );
	Lcd_Symbol( COLON, 0 );
	
#if 0
	if( num>=1000 )
		Lcd_Map(0,'0'+(num/1000)%10);
	else
		Lcd_Map(0,' ');
	if(num>=100)
		Lcd_Map(1,'0'+(num/100)%10);
	else
		Lcd_Map(1,' ');
	if(num>=10)
		Lcd_Map(2,'0'+(num/10)%10);
	else
		Lcd_Map(2,' ');
	Lcd_Map(3,'0'+num%10);
#else
	// support negative numbers up to 3 digits
	// (TODO: this was added later and may need not be smaller than modifying the previous implementation)
	int8_t m = 0;
	if( num < 0)
	{
		num = -num;
		m = 1;
		Lcd_Map(0,'-');
	}
	
	// 4 digits, starting last
	for(int8_t i = (LCD_MAX_CHARS-1); i >= m; i--)
	{
		// write digit or blank
		if( num || i == 3)
		{
			Lcd_Map(i,'0' + num%10);
		}
		else
		{
			Lcd_Map(i,' ');
		}
		num /= 10;
	}
#endif
}
示例#5
0
文件: Lcd.c 项目: gnbl/OpenZero
/// \brief .
/// 
/// 
void LCD_blinkMonths( void )
{
	Lcd_Symbol( DOT, 1 );
	Lcd_Symbol( COLON, 0 );
	if( lcd_blinker % 2 )
	{
		Lcd_Map(0,' ');
		Lcd_Map(1,' ');
	}
	else
	{
		Lcd_Map(0,'0'+(rtc.month/10)%10);
		Lcd_Map(1,'0'+rtc.month%10);
	}
	Lcd_Map(2,'0'+(rtc.date/10)%10);
	Lcd_Map(3,'0'+rtc.date%10);
}
示例#6
0
文件: Lcd.c 项目: gnbl/OpenZero
/// \brief .
/// 
/// 
void LCD_blinkMinutes( void )
{
	Lcd_Symbol( DOT, 0 );
	Lcd_Symbol( COLON, 1 );
	Lcd_Map(0,'0'+(rtc.hour/10)%10);
	Lcd_Map(1,'0'+rtc.hour%10);
	if( lcd_blinker % 2 )
	{
		Lcd_Map(2,' ');
		Lcd_Map(3,' ');
	}
	else
	{
		Lcd_Map(2,'0'+(rtc.minute/10)%10);
		Lcd_Map(3,'0'+rtc.minute%10);
	}
}
示例#7
0
文件: Lcd.c 项目: gnbl/OpenZero
/// \brief .
/// 
/// 
void LCD_blinkYears( void )
{
	Lcd_Symbol( DOT, 0 );
	Lcd_Symbol( COLON, 0 );
	if( lcd_blinker % 2 )
	{
		Lcd_Map(0,' ');
		Lcd_Map(1,' ');
		Lcd_Map(2,' ');
		Lcd_Map(3,' ');
	}
	else
	{
		Lcd_Map(0,'0'+(rtc.year/1000)%10);
		Lcd_Map(1,'0'+(rtc.year/100)%10);
		Lcd_Map(2,'0'+(rtc.year/10)%10);
		Lcd_Map(3,'0'+rtc.year%10);
	}
}
示例#8
0
文件: Lcd.c 项目: gnbl/OpenZero
/// \brief .
/// 
/// 
void LCD_showTemp( uint8_t temp )
{
	Lcd_Symbol( DOT, 1 );
	Lcd_Symbol( COLON, 0 );
	
	// temperature is in 10 x degrees C
	Lcd_Symbol( DOT, 1 );

	if( temp>=100 )
		Lcd_Map(0,'0'+(temp/100)%10);
	else
		Lcd_Map(0,' ');
	if(temp>=10)
		Lcd_Map(1,'0'+(temp/10)%10);
	else
		Lcd_Map(1,' ');
	Lcd_Map(2,'0'+temp%10);
	Lcd_Map(3,'.');
}
示例#9
0
文件: Lcd.c 项目: gnbl/OpenZero
/// \brief Display battery voltage.
/// 
/// 
void LCD_showVoltage( uint16_t voltage )
{
	LCD_writeNum(voltage);
	Lcd_Symbol( DOT, 1 );
	Lcd_Symbol( BAT, 1 );
}