Line 1... |
Line 1... |
1 |
//Jan Chroust 15.4.2013 |
1 |
#define VERSION "0.1" |
2 |
|
- |
|
- |
|
2 |
#define ID "$Id: main.c 2916 2013-04-14 17:42:03Z kaklik $" |
3 |
|
3 |
|
4 |
#include "main.h" |
4 |
#include "main.h" |
5 |
|
5 |
|
6 |
#define EEPROM_SDA PIN_B0 |
- |
|
7 |
#define EEPROM_SCL PIN_B1 |
- |
|
8 |
#use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL) |
6 |
#use i2c(master, sda=PIN_B0, scl=PIN_B1) |
9 |
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD |
7 |
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD |
10 |
|
8 |
|
11 |
#define MPL3115_ADDR_R 0xC1 //addresa pro cteni |
9 |
#define MPL3115_ADDR_R 0xC1 //addresa pro cteni |
12 |
#define MPL3115_ADDR_W 0xC0 |
10 |
#define MPL3115_ADDR_W 0xC0 |
13 |
|
11 |
|
Line 133... |
Line 131... |
133 |
mpl3115_setA(); //nastaveni pro vysku a teplotu |
131 |
mpl3115_setA(); //nastaveni pro vysku a teplotu |
134 |
delay_ms (500); |
132 |
delay_ms (500); |
135 |
a=mpl3115_A(); |
133 |
a=mpl3115_A(); |
136 |
|
134 |
|
137 |
|
135 |
|
138 |
printf("Teplota: %10.4f(stupne)\r\n", t); |
136 |
printf("Teplota: %1.4f\r\n", t); |
139 |
printf("Tlak: %10.4f(Pa)\r\n", p); |
137 |
printf("Tlak: %10.4f(Pa)\r\n", p); |
140 |
printf("Výka: %10.4f(m)\r\n", a); |
138 |
printf("Výka: %10.4f(m)\r\n", a); |
141 |
|
139 |
|
142 |
delay_ms (1000); |
140 |
delay_ms (1000); |
143 |
} |
141 |
} |
144 |
|
- |
|
145 |
|
- |
|
146 |
} |
142 |
} |
147 |
|
143 |
|
148 |
|
144 |
|