Skip to main content
added 275 characters in body
Source Link
ocrdu
  • 1.8k
  • 3
  • 12
  • 24

You are not going to get good answers without showing your code, but maybe this is a good guess of what you want:

why not try something roughly like this (untested and incomplete)?

Adafruit_BMP3XX bmp;
float startPressure;
float difference;

void setup() {
  bmp.begin_I2C();
  startPressure = bmp.readPressure();
} 

void loop() {
  difference = startPressure - bmp.readPressure();
}

Or, better:

Adafruit_BMP3XX bmp;

void setup() {
  bmp.begin_I2C();
} 

void loop() {
  static const float startPressure = bmp.readPressure();
  static float difference;
  difference = startPressure - bmp.readPressure();
}

You are not going to get good answers without showing your code, but maybe this is a good guess of what you want:

why not try something roughly like this (untested and incomplete)?

Adafruit_BMP3XX bmp;
float startPressure; 

void setup() {
  bmp.begin_I2C();
  startPressure = bmp.readPressure();
} 

void loop() {
  static float difference;
  difference = startPressure - bmp.readPressure();
}

You are not going to get good answers without showing your code, but maybe this is a good guess of what you want:

why not try something roughly like this (untested and incomplete)?

Adafruit_BMP3XX bmp;
float startPressure;
float difference;

void setup() {
  bmp.begin_I2C();
  startPressure = bmp.readPressure();
} 

void loop() {
  difference = startPressure - bmp.readPressure();
}

Or, better:

Adafruit_BMP3XX bmp;

void setup() {
  bmp.begin_I2C();
} 

void loop() {
  static const float startPressure = bmp.readPressure();
  static float difference;
  difference = startPressure - bmp.readPressure();
}
Source Link
ocrdu
  • 1.8k
  • 3
  • 12
  • 24

You are not going to get good answers without showing your code, but maybe this is a good guess of what you want:

why not try something roughly like this (untested and incomplete)?

Adafruit_BMP3XX bmp;
float startPressure; 

void setup() {
  bmp.begin_I2C();
  startPressure = bmp.readPressure();
} 

void loop() {
  static float difference;
  difference = startPressure - bmp.readPressure();
}