Hello, I'm using BMP180 sensor and I want to send data (only pressure) via simple 433Mhz module and get it. I can read sensor, but I can't send this data. I'm trying to combine RadioHead library for transmitter with SFE_BMP180 libary. Maybe someone could help me? In the code below in the end I just left original RadioHead code example for word ''hello''.
#include <RH_ASK.h>
#ifdef RH_HAVE_HARDWARE_SPI
#include <SPI.h> // Not actually used but needed to compile
#include <SFE_BMP180.h>
#include <Wire.h>
SFE_BMP180 pressure;
#endif
RH_ASK driver;
void setup()
{
if (pressure.begin())
Serial.println("BMP180 init success");
else
{
Serial.println("BMP180 init fail\n\n");
Serial.println("Check connection");
while (1);
}
#ifdef RH_HAVE_SERIAL
Serial.begin(9600); // Debugging only
#endif
if (!driver.init())
#ifdef RH_HAVE_SERIAL
Serial.println("init failed");
#else
;
#endif
}
void loop()
{
char status;
double P, T;
status = pressure.startPressure(3);
if (status != 0)
{
delay(status);
status = pressure.getPressure(P, T);
if (status != 0)
{
Serial.print(" pa = ");
Serial.print(P * 0.000986923, 2);
}
}
const char *msg = "hello";
driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();
delay(200);
}