Rev Author Line No. Line
2159 kaklik 1 #include "main.h"
1944 kaklik 2  
3 #define LCD_ENABLE_PIN PIN_E0 ////
4 #define LCD_RS_PIN PIN_E1 ////
5 #define LCD_RW_PIN PIN_E2 ////
6 #define LCD_DATA4 PIN_D4 ////
7 #define LCD_DATA5 PIN_D5 ////
8 #define LCD_DATA6 PIN_D6 ////
9 #define LCD_DATA7 PIN_D7
10 #include <lcd.c>
11  
12 #define ONE_WIRE_PIN PIN_C6
13 #include "ds1820.c"
14  
15 void main()
16 {
17 setup_adc_ports(NO_ANALOGS);
18 setup_adc(ADC_CLOCK_DIV_2);
19 setup_psp(PSP_DISABLED);
20 setup_spi(SPI_SS_DISABLED);
21 setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
22 setup_timer_1(T1_DISABLED);
23 setup_timer_2(T2_DISABLED,0,1);
24 setup_ccp1(CCP_OFF);
25 setup_comparator(NC_NC_NC_NC);
26 setup_vref(FALSE);
27  
28 lcd_init();
29  
30 lcd_putc("\fReady...\n");
31  
32  
33 while (TRUE)
34 {
35 lcd_gotoxy(1,2);
36 printf(lcd_putc,"T: %f K ",ds1820_read()+273.15);
37 Delay_ms(100);
38 }
39 }