o: ActiveSupport::Cache::Entry :@compressedF:@value"G&"A&
| main.c | ||
|---|---|---|
| 18 | 18 |
#define sht_clk_pin PIN_D1 |
| 19 | 19 |
#include "..\SHT.c" |
| 20 | 20 |
|
| 21 |
#use i2c(master, sda=PIN_C4, scl=PIN_C3) |
|
| 22 |
#include "..\SHT25.h" |
|
| 23 |
|
|
| 21 | 24 |
#define CSN_SPI PIN_C2 // preassure sensor connection |
| 22 | 25 |
#include "..\MPL115A1.c" |
| 23 | 26 |
|
| ... | ... | |
| 45 | 48 |
timer0_overflow_count++; |
| 46 | 49 |
} |
| 47 | 50 |
|
| 48 |
#int_default |
|
| 51 |
/*#int_default
|
|
| 49 | 52 |
void default_isr() |
| 50 | 53 |
{
|
| 51 | 54 |
printf("Unexplained interrupt\r\n");
|
| 52 | 55 |
} |
| 53 |
|
|
| 56 |
*/ |
|
| 54 | 57 |
void welcome(void) // Welcome message |
| 55 | 58 |
{
|
| 56 | 59 |
char REV[50]=ID; // Buffer for concatenate of a version string |
| ... | ... | |
| 58 | 61 |
if (REV[strlen(REV)-1]=='$') REV[strlen(REV)-1]=0; |
| 59 | 62 |
printf("\r\n\r\n# AWS01A %s (C) 2013 www.mlab.cz \r\n",VER); // Welcome message
|
| 60 | 63 |
printf("#%s\r\n",&REV[4]);
|
| 61 |
printf("# ver seq temp[mK] hum_temp[mK] hum[%%] ");
|
|
| 62 |
printf("bar_temp[mK] pressure[hPa] Anemo[m/s]check\r\n\r\n");
|
|
| 64 |
// printf("# ver seq ");
|
|
| 65 |
// printf("#temp[mK] hum_temp[mK] hum[%%] ");
|
|
| 66 |
// printf("bar_temp[mK] pressure[hPa] Anemo[m/s]check\r\n\r\n");
|
|
| 63 | 67 |
} |
| 64 | 68 |
|
| 65 | 69 |
void main() |
| ... | ... | |
| 73 | 77 |
setup_adc(ADC_CLOCK_DIV_2); |
| 74 | 78 |
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
| 75 | 79 |
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1|T1_CLK_OUT); |
| 76 |
// setup_timer_1(T1_INTERNAL|T1_DIV_BY_8); |
|
| 77 | 80 |
setup_timer_2(T2_DISABLED,0,1); |
| 78 | 81 |
setup_ccp1(CCP_OFF); |
| 79 | 82 |
setup_comparator(NC_NC_NC_NC); // This device COMP currently not supported by the PICWizard |
| ... | ... | |
| 91 | 94 |
sht_init(); |
| 92 | 95 |
barometer_present = MPL_init(); // get correction coefficients from the sensor |
| 93 | 96 |
|
| 97 |
SHT25_soft_reset(); |
|
| 98 |
|
|
| 94 | 99 |
restart_wdt(); //---WDT |
| 95 | 100 |
|
| 96 | 101 |
while (TRUE) |
| ... | ... | |
| 110 | 115 |
sht_rd(SHT_temp1,SHT_hum1); |
| 111 | 116 |
SHT_temp1 = (SHT_temp1 + 273.15)*100; |
| 112 | 117 |
|
| 118 |
SHT_temp2 = SHT25_get_temp(); |
|
| 119 |
SHT_hum2 = SHT25_get_hum(); |
|
| 120 |
|
|
| 113 | 121 |
if (barometer_present == TRUE) |
| 114 | 122 |
{
|
| 115 | 123 |
barometer_temperature = (MPL_get_temperature() + 273.15)*100; |