Hi guys
So usually when you want to define an integer its as easy as int height = 0; but take a look at this, i know im doing something wrong but i cant find a solution
#include <SFE_BMP180.h>
#include <Wire.h>
SFE_BMP180 pressure;
#define ALTITUDE 1667.0
int oldpress = 0 ;
void setup()
{
Serial.begin(9600);
Serial.println("REBOOT");
// Initialize the sensor (it is important to get calibration values stored on the device).
if (pressure.begin())
Serial.println("BMP180 init success");
else
{
// Oops, something went wrong, this is usually a connection problem,
// see the comments at the top of this sketch for the proper connections.
Serial.println("BMP180 init fail\n\n");
while(1); // Pause forever.
}
pinMode(4, OUTPUT);
}
void loop()
{
char status;
double T,P,p0,a;
status = pressure.startPressure(3);
if (status != 0)
{
// Wait for the measurement to complete:
delay(status);
status = pressure.getPressure(P,T);
if (status != 0)
{
// Print out the measurement:
Serial.print("absolute pressure HPA : ");
Serial.print(P*10);
Serial.println(" hpa, ");
oldPress = (P);
if (pressure.startPressure(3) < P )
{
//digitalWrite(4, HIGH);
}
delay(100);
}
else Serial.println("error retrieving pressure measurement\n");
}
else Serial.println("error starting pressure measurement\n");
}
take a look at oldPress = (P); , how do i get that P value that gets printed into the oldPress int ?