Line 112... |
Line 112... |
112 |
welcome(); |
112 |
welcome(); |
113 |
set_mag(); //nastaveni magnetometru pro smer vetru |
113 |
set_mag(); //nastaveni magnetometru pro smer vetru |
114 |
|
114 |
|
115 |
while(TRUE) |
115 |
while(TRUE) |
116 |
{ |
116 |
{ |
117 |
int i=0; |
117 |
unsigned int32 i=0; |
118 |
|
118 |
|
119 |
mpl3115_setP(); //nastaveni pro tlak a teplotu |
119 |
mpl3115_setP(); //nastaveni pro tlak a teplotu |
120 |
delay_ms (500); |
120 |
delay_ms (500); |
121 |
altimet_t=mpl3115_T(); |
121 |
altimet_t=mpl3115_T(); |
122 |
altimet_p=mpl3115_P(); |
122 |
altimet_p=mpl3115_P(); |
123 |
|
123 |
|
124 |
mpl3115_setA(); //nastaveni pro vysku a teplotu |
124 |
mpl3115_setA(); //nastaveni pro vysku a teplotu |
125 |
delay_ms (500); |
125 |
delay_ms (500); |
126 |
altimet_a = mpl3115_A(); |
126 |
altimet_a = mpl3115_A(); |
- |
|
127 |
|
- |
|
128 |
if (i<10000) sht_config = SHT25_RH12_T14 | SHT25_HEATER_OFF; // loop alters on chip heater on and off to check correct function |
- |
|
129 |
else |
- |
|
130 |
{ |
- |
|
131 |
sht_config = SHT25_RH12_T14 | SHT25_HEATER_ON; |
- |
|
132 |
if (i > 10050) i = 0; |
- |
|
133 |
} |
- |
|
134 |
|
127 |
|
135 |
|
128 |
sht25_t = SHT25_get_temp(); //mereni hodnot z SHT25 |
136 |
sht25_t = SHT25_get_temp(); //mereni hodnot z SHT25 |
129 |
sht25_h = SHT25_get_hum(); |
137 |
sht25_h = SHT25_get_hum(); |
- |
|
138 |
SHT25_setup(sht_config); |
130 |
|
139 |
|
131 |
smer_v = wind_direction(); //vrati azimut aktualniho smeru vetru |
140 |
smer_v = wind_direction(); //vrati azimut aktualniho smeru vetru |
132 |
anemo = wind_speed(); |
141 |
anemo = wind_speed(); |
133 |
|
142 |
|
134 |
printf(" %6.2f %7.2f %9.2f %6.2f %6.2f %5.2f %6.2f \n\r", altimet_t, altimet_a, altimet_p, sht25_t, sht25_h, smer_v, anemo); |
143 |
printf(" %6.2f %7.2f %9.2f %6.2f %6.2f %X %5.2f %6.2f \n\r", altimet_t, altimet_a, altimet_p, sht25_t, sht25_h, sht_config, smer_v, anemo); |
135 |
|
144 |
|
136 |
delay_ms(1000); |
145 |
delay_ms(1000); |
- |
|
146 |
i++; |
137 |
} |
147 |
} |
138 |
} |
148 |
} |
139 |
|
149 |
|