Line 12... |
Line 12... |
12 |
#include "../SHT25.h" |
12 |
#include "../SHT25.h" |
13 |
#include "../LTS01.h" |
13 |
#include "../LTS01.h" |
14 |
#include "./HMC5883L.h" |
14 |
#include "./HMC5883L.h" |
15 |
#include <math.h> |
15 |
#include <math.h> |
16 |
|
16 |
|
- |
|
17 |
#define MPL3115_ADDR_R 0xC1 //addresa pro cteni |
- |
|
18 |
#define MPL3115_ADDR_W 0xC0 |
- |
|
19 |
|
- |
|
20 |
#include "../MPL3115.h" |
- |
|
21 |
|
17 |
|
22 |
|
18 |
void main() |
23 |
void main() |
19 |
{ |
24 |
{ |
20 |
float temp1, temp2, humidity; |
25 |
float temp1, temp2, temp3, humidity, preasure; |
21 |
int16 i=0; |
26 |
int16 i=0; |
22 |
|
27 |
|
23 |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
28 |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
24 |
setup_adc(ADC_CLOCK_DIV_2); |
29 |
setup_adc(ADC_CLOCK_DIV_2); |
25 |
setup_spi(SPI_SS_DISABLED); |
30 |
setup_spi(SPI_SS_DISABLED); |
Line 53... |
Line 58... |
53 |
lcd_gotoxy(1,1); |
58 |
lcd_gotoxy(1,1); |
54 |
temp1 = SHT25_get_temp(); |
59 |
temp1 = SHT25_get_temp(); |
55 |
humidity = SHT25_get_hum(); |
60 |
humidity = SHT25_get_hum(); |
56 |
temp2= LTS01_get_temp(); |
61 |
temp2= LTS01_get_temp(); |
57 |
hmc5883l_read_data(); |
62 |
hmc5883l_read_data(); |
58 |
|
63 |
|
- |
|
64 |
temp3=mpl3115_T(); |
- |
|
65 |
preasure=mpl3115_P(); |
- |
|
66 |
mpl3115_setP(); //nastaveni pro tlak a teplotu |
- |
|
67 |
|
59 |
printf(lcd_putc,"%f C %f \%%",temp1, humidity); |
68 |
printf(lcd_putc,"%2.2f%cC %2.2f\%%",temp1, 0xb2, humidity); |
60 |
lcd_gotoxy(1,2); |
69 |
lcd_gotoxy(1,2); |
61 |
printf(lcd_putc," %f C",temp2); |
70 |
printf(lcd_putc,"%2.2f%cC %6.0fPa ",temp2, 0xb2, preasure); |
62 |
printf("%ld %f %f %f ",i, temp1, humidity, temp2); |
- |
|
- |
|
71 |
|
63 |
printf("%Ld %Ld %Ld \n\r", compass.x, compass.y, compass.z); |
72 |
printf("%ld %f %f %f %6.2f %3.2f %Ld %Ld %Ld \n\r",i, temp1, humidity, temp2, preasure, temp3, compass.x, compass.y, compass.z); |
64 |
i++; |
73 |
i++; |
- |
|
74 |
|
65 |
Delay_ms(100); |
75 |
Delay_ms(100); |
66 |
} |
76 |
} |
67 |
|
77 |
|
68 |
} |
78 |
} |