3275 |
kaklik |
1 |
#include "main.h" |
3095 |
jacho |
2 |
|
3275 |
kaklik |
3 |
#define S_SDA PIN_C4 |
|
|
4 |
#define S_SCL PIN_C3 |
3095 |
jacho |
5 |
#use i2c(master, sda=S_SDA, scl=S_SCL) |
3275 |
kaklik |
6 |
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) |
3095 |
jacho |
7 |
|
3275 |
kaklik |
8 |
#include "../LTS01.h" |
3095 |
jacho |
9 |
|
|
|
10 |
void main() |
|
|
11 |
{ |
|
|
12 |
|
|
|
13 |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
|
|
14 |
setup_adc(ADC_CLOCK_DIV_2); |
|
|
15 |
setup_spi(SPI_SS_DISABLED); |
|
|
16 |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
17 |
setup_timer_1(T1_DISABLED); |
|
|
18 |
setup_timer_2(T2_DISABLED,0,1); |
|
|
19 |
setup_ccp1(CCP_OFF); |
|
|
20 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
|
|
21 |
|
3275 |
kaklik |
22 |
printf("Simple Thermomether with LTS01A sensor \r\n",); |
|
|
23 |
printf("(c) MLAB.cz 2013 JACHO \r\n",); |
3095 |
jacho |
24 |
|
|
|
25 |
while(TRUE) |
|
|
26 |
{ |
3275 |
kaklik |
27 |
printf("T: %f\r\n", LTS01_get_temp()); |
|
|
28 |
delay_ms(500); |
3095 |
jacho |
29 |
} |
|
|
30 |
} |
|
|
31 |
|