/Modules/Sensors/ALTIMET01A/SW/MPL3115/PIC16F887/main.c
3,8 → 3,8
 
#include "main.h"
 
#use i2c(master, sda=PIN_B0, scl=PIN_B1)
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD
#use i2c(master, sda=PIN_C4, scl=PIN_C3)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) //rcv TXD xmit RXD
 
#define MPL3115_ADDR_R 0xC1 //addresa pro cteni
#define MPL3115_ADDR_W 0xC0
119,7 → 119,8
{
 
float p, t, a;
printf("Tlakomer nebo vyskomer \r\n",);
printf("\r\nMLAB Barometer and Altimeter demo code \r\n",);
printf("Temperature [deg C] Preassure [Pa] Altitude [m] \r\n",);
while(TRUE)
{
132,11 → 133,8
delay_ms (500);
a=mpl3115_A();
 
printf("%3.1f %6.1f %5.2f \r\n", t, p, a);
 
printf("Teplota: %1.4f\r\n", t);
printf("Tlak: %10.4f(Pa)\r\n", p);
printf("Výška: %10.4f(m)\r\n", a);
 
delay_ms (1000);
}
}