18,6 → 18,9 |
#define sht_clk_pin PIN_D1 |
#include "..\SHT.c" |
|
#use i2c(master, sda=PIN_C4, scl=PIN_C3) |
#include "..\SHT25.h" |
|
#define CSN_SPI PIN_C2 // preassure sensor connection |
#include "..\MPL115A1.c" |
|
45,12 → 48,12 |
timer0_overflow_count++; |
} |
|
#int_default |
/*#int_default |
void default_isr() |
{ |
printf("Unexplained interrupt\r\n"); |
} |
|
*/ |
void welcome(void) // Welcome message |
{ |
char REV[50]=ID; // Buffer for concatenate of a version string |
58,8 → 61,9 |
if (REV[strlen(REV)-1]=='$') REV[strlen(REV)-1]=0; |
printf("\r\n\r\n# AWS01A %s (C) 2013 www.mlab.cz \r\n",VER); // Welcome message |
printf("#%s\r\n",&REV[4]); |
printf("# ver seq temp[mK] hum_temp[mK] hum[%%] "); |
printf("bar_temp[mK] pressure[hPa] Anemo[m/s]check\r\n\r\n"); |
// printf("# ver seq "); |
// printf("#temp[mK] hum_temp[mK] hum[%%] "); |
// printf("bar_temp[mK] pressure[hPa] Anemo[m/s]check\r\n\r\n"); |
} |
|
void main() |
73,7 → 77,6 |
setup_adc(ADC_CLOCK_DIV_2); |
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1|T1_CLK_OUT); |
// setup_timer_1(T1_INTERNAL|T1_DIV_BY_8); |
setup_timer_2(T2_DISABLED,0,1); |
setup_ccp1(CCP_OFF); |
setup_comparator(NC_NC_NC_NC); // This device COMP currently not supported by the PICWizard |
91,6 → 94,8 |
sht_init(); |
barometer_present = MPL_init(); // get correction coefficients from the sensor |
|
SHT25_soft_reset(); |
|
restart_wdt(); //---WDT |
|
while (TRUE) |
110,6 → 115,9 |
sht_rd(SHT_temp1,SHT_hum1); |
SHT_temp1 = (SHT_temp1 + 273.15)*100; |
|
SHT_temp2 = SHT25_get_temp(); |
SHT_hum2 = SHT25_get_hum(); |
|
if (barometer_present == TRUE) |
{ |
barometer_temperature = (MPL_get_temperature() + 273.15)*100; |