#include <18F4550.h>
// PIC BEÁLLÍTÁSOK
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN,NOBROWNOUT    ,                  INTRC,NOPUT,NOCPD
//#FUSES  NOPROTECT, NOPUT, NOWDT, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NOMCLR
#use delay(clock=48000000)
#use rs232(baud=9600,xmit=PIN_B5,rcv=PIN_B2,ERRORS)

/***********************************************************/
//                                                         //
//                     HASZNÁLT LÁBAK                      //
//                                                         //
/***********************************************************/
// 1 VEZETÉKES KOMMUNIKÁCIÓ LÁBA
#define DQ        PIN_A0
// LCD KIJELZŐ BEKÖTÉSEI
#define LCD_DB4   PIN_C7
#define LCD_DB5   PIN_C6
#define LCD_DB6   PIN_B4
#define LCD_DB7   PIN_B5
#define LCD_RS    PIN_B7
#define LCD_RW    PIN_B2
#define LCD_E     PIN_B6
/***********************************************************/
//                                                         //
//                  INCLUDE ÁLLOMÁNYOK                     //
//                                                         //
/***********************************************************/
// LCD KEZELÉS
#include <FLEX_LCD420.c>
//#include <DS1820.c>
// 1 VEZETÉKES KOMMUNIKÁCIÓ
#include <1wire.c>
void menu(int i)
{
   switch(i)
   {
      case 1:   // INFORMÁCIÓS MENÜ
            lcd_putc("\f");
            printf(lcd_putc,"\nINFORMACIOS MENU");
            printf(lcd_putc,"\nKINT BENT HATUL");
            printf(lcd_putc,"\n100C 80C  90C");
            printf(lcd_putc,"\n***************");
            break;

   }
}
void main()
   {
      lcd_init();
      lcd_putc("\f");
     
      while(1)
         {
            lcd_gotoxy(1,1);
            printf(lcd_putc,"%d",FindDevices());
            //menu(1);
            //result = (float) temp3 / 2.0;   //Calculation for DS18S20 with 0.5 deg C resolution

           // lcd_gotoxy(1,1);
           // printf(lcd_putc,"%3.1f%cC",temperature,223);

            //printf(lcd_putc, "\f %3.1f",temperature);
           // printf(lcd_putc, "\nNext is the 2nd line");
          // printf(lcd_putc, "\nThis is the 3rd line");
          // printf(lcd_putc, "\nFinally the 4th line");

           // delay_ms(3000);

           // delay_ms(500);
         }
   }

