#include <io.h>
#include <delay.h>
#include <alcd.h>
#include <stdlib.h>
#include <stdio.h>

void main(void)
{
    unsigned char counter = 250;    
    char str[32];
    
    lcd_init(16);
    lcd_clear();
    
    lcd_puts("App started!");
    delay_ms(1000);
    lcd_clear();
    
    while(1)
    {
        counter++; // 25 -> "25"
        
        //itoa(counter, str);       
        sprintf(str, "counter: %-3d", counter);    // counter: XXX
        lcd_gotoxy(0,0);
        lcd_puts(str);         
        delay_ms(500);        
    }      
}