Line 21... |
Line 21... |
21 |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
21 |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
22 |
setup_timer_1(T1_DISABLED); |
22 |
setup_timer_1(T1_DISABLED); |
23 |
setup_timer_2(T2_DISABLED,0,1); |
23 |
setup_timer_2(T2_DISABLED,0,1); |
24 |
setup_ccp1(CCP_OFF); |
24 |
setup_ccp1(CCP_OFF); |
25 |
setup_comparator(NC_NC_NC_NC); // This device COMP currently not supported by the PICWizard |
25 |
setup_comparator(NC_NC_NC_NC); // This device COMP currently not supported by the PICWizard |
26 |
setup_oscillator(OSC_4MHZ); |
26 |
setup_oscillator(OSC_8MHZ); |
27 |
|
27 |
|
28 |
|
28 |
|
- |
|
29 |
printf("Simple Thermomether\r\n",); |
29 |
lcd_init(); |
30 |
printf("(c) Kaklik 2013\r\n"); |
30 |
|
31 |
printf("www.mlab.cz\r\n"); |
31 |
|
32 |
|
- |
|
33 |
lcd_init(); |
32 |
lcd_putc("(c) Kaklik 2011"); |
34 |
lcd_putc("(c) Kaklik 2013"); |
33 |
lcd_gotoxy(3,2); |
35 |
lcd_gotoxy(3,2); |
34 |
lcd_putc("www.mlab.cz"); |
36 |
lcd_putc("www.mlab.cz"); |
35 |
Delay_ms(2000); |
37 |
Delay_ms(2000); |
36 |
|
38 |
|
37 |
lcd_putc("\fReady..\n"); |
- |
|
38 |
Delay_ms(100); |
- |
|
39 |
|
- |
|
40 |
while (TRUE) |
39 |
while (TRUE) |
41 |
{ |
40 |
{ |
42 |
lcd_gotoxy(1,2); |
41 |
lcd_gotoxy(1,2); |
43 |
printf(lcd_putc,"T: %f K ",ds1820_read()+273.15); |
42 |
printf(lcd_putc,"T: %f K ",ds1820_read()+273.15); |
44 |
printf("$T1.0 %f \r\n",ds1820_read()+273.15); |
43 |
printf("$T1.0 %f \r\n",ds1820_read()+273.15); |