Rev Author Line No. Line
3275 kaklik 1 #include "main.h"
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 #include "../SHT25.h"
13 #include "../LTS01.h"
14  
15 void main()
16 {
17 float temp1, temp2, humidity;
18 int16 i=0;
19  
20 setup_adc_ports(NO_ANALOGS|VSS_VDD);
21 setup_adc(ADC_CLOCK_DIV_2);
22 setup_spi(SPI_SS_DISABLED);
23 setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
24 setup_timer_1(T1_DISABLED);
25 setup_timer_2(T2_DISABLED,0,1);
26 setup_ccp1(CCP_OFF);
27 setup_comparator(NC_NC_NC_NC); // This device COMP currently not supported by the PICWizard
28 setup_oscillator(OSC_8MHZ);
29  
30  
31 printf("GeoMet01A\r\n",);
32 printf("(c) Kaklik 2013\r\n");
33 printf("www.mlab.cz\r\n");
34  
35 lcd_init();
36 lcd_putc("(c) Kaklik 2013");
37 lcd_gotoxy(3,2);
38 lcd_putc("www.mlab.cz");
39 Delay_ms(2000);
40 lcd_init();
41  
42 while (TRUE)
43 {
44 lcd_gotoxy(1,1);
45 temp1 = SHT25_get_temp();
46 humidity = SHT25_get_hum();
47 temp2= LTS01_get_temp();
48  
49 printf(lcd_putc,"%f C %f \%% \r\n",temp1, humidity);
50 lcd_gotoxy(1,2);
51 printf(lcd_putc," %f C",temp2);
52 printf("%ld %f %f %f \r\n",i, temp1, humidity, temp2);
53 i++;
54 Delay_ms(100);
55 }
56  
57 }