#include "C:\RS\projekty\4lcdmob\main.h"

#define LCD_RS          PIN_B1      // rizeni registru LCD displeje
#define LCD_E           PIN_B0      // enable LCD displeje
#define LCD_DATA_LSB    PIN_C0     // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)

#include "mylcd.c"

int sig[20];

void main()
{

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);

lcd_init();
delay_ms(150);

printf(lcd_putc,"Baterie je nabita na");

while(TRUE)
{  
   printf("AT+CBC\r");
   gets(sig);
   getc();
   gets(sig);
   
 
 
   lcd_gotoxy(6,2);
   printf(lcd_putc,"%c%c procent",sig[9],sig[10]);
   delay_ms(2500);
  
}
}