示例#1
0
void draw_banner(struct Banner *banner, int y) {
	LCD_HorizontalLine(y, 0, LCD_WIDTH - 1, BLACK);
	LCD_HorizontalLine(y + 8, 0, LCD_WIDTH - 1, BLACK);
	LCD_HorizontalLine(y + 9, 0, LCD_WIDTH - 1, BLACK);

	LCD_TextLocate(banner->offset, y + 2);
	LCD_Text(banner->string);
	LCD_TextLocate(banner->offset + (banner->len * (LCD_CHAR_WIDTH + 1)), y + 2);
	LCD_Text(banner->string);
}
int main(void)
{
	binToDecDigits(1234, display, 4);
	
    scheduler_init(display);
	serial_init(onReceive);
	
	scheduler_addPeriodicTask(sendText, 5000);
	
	LCD_Initalize();
	LCD_Command(HD44780_DISPLAY_ONOFF|HD44780_DISPLAY_ON);
	LCD_Text("Ala ma kota!");
	
	scheduler_run();
}