This seems congruent with SPI communication theory.
Now the difficulty is finding the library that allows multiple SPI-connected devices to:
Uno receives data from BMP280(1) and displays on LCD;
Uno receives data from BMP280(2) and displays on LCD;
Uno receives data from BMP280(3) and displays on LCD;
The three BMP280 libraries found are poorly documented and do not demonstrate multiple device capabilities:
Adafruit_BMP280_Library
BMP280_DEV
BMP280_Grove
I tried toggle:
digitalWrite (ss1, LOW) and digitalWrite (ss1, HIGH)
digitalWrite (ss2, LOW) and digitalWrite (ss2, HIGH)
digitalWrite (ss3, LOW) and digitalWrite (ss3, HIGH)
and create different instances for BMP(1), BMP(2) and BMP(3) but it didn't work.
There are plenty of WEB demonstrations of how to connect a BMP280 sensor to Uno (or ESP) but I didn't find one that connected two or more BMP280 via SPI or IIC (I2C). In the forums, a lot of speculation but nothing concrete.
Remember to add level shifters such as the 74hct125 and power the things off the 3.3V output of your Arduino. Otherwise you're going to destroy those sensors very very quickly.
Or use I2C, enabling the SCL line as needed. Needs diode and resistor for each SCL:
The three BMP280 libraries found are poorly documented and do not demonstrate multiple device capabilities:
Adafruit_BMP280_Library
BMP280_DEV
BMP280_Grove
Ouch! As the author of the BMP280_DEV library, I admit that there's no example code with multiple devices, but I have to take issue with your assertion that it's poorly documented.
In my opinion, the BMP280_DEV documentation provides step-by-step instructions on how to use the barometer, together with a variety of examples for operating the BMP280 in both NORMAL and FORCED modes with I2C and SPI: https://github.com/MartinL1/BMP280_DEV.
The following code shows how to use the BMP280_DEV library with multiple BMP280 devices over a SPI interface:
///////////////////////////////////////////////////////////////////////////////
// BMP280_DEV - SPI Communications, Default Configuration, Normal Conversion
///////////////////////////////////////////////////////////////////////////////
#include <BMP280_DEV.h> // Include the BMP280_DEV.h library
float temperature, pressure, altitude; // Create the temperature, pressure and altitude variables
BMP280_DEV bmp280_1(10); // Instantiate (create) a BMP280_DEV object and set-up for SPI operation on digital pin D10
BMP280_DEV bmp280_2(9); // Instantiate (create) a BMP280_DEV object and set-up for SPI operation on digital pin D9
void setup()
{
Serial.begin(115200); // Initialise the serial port
bmp280_1.begin(); // Default initialisation, place the BMP280_1 into SLEEP_MODE
bmp280_1.setTimeStandby(TIME_STANDBY_2000MS); // Set the standby time to 2 seconds
bmp280_1.startNormalConversion(); // Start BMP280_1 continuous conversion in NORMAL_MODE
bmp280_2.begin(); // Default initialisation, place the BMP280_2 into SLEEP_MODE
bmp280_2.setTimeStandby(TIME_STANDBY_2000MS); // Set the standby time to 2 seconds
bmp280_2.startNormalConversion(); // Start BMP280_2 continuous conversion in NORMAL_MODE
}
void loop()
{
if (bmp280_1.getMeasurements(temperature, pressure, altitude)) // Check if the measurement is complete
{
Serial.print(F("BMP280_1 "));
Serial.print(temperature); // Display the results
Serial.print(F("*C "));
Serial.print(pressure);
Serial.print(F("hPa "));
Serial.print(altitude);
Serial.println(F("m"));
}
if (bmp280_2.getMeasurements(temperature, pressure, altitude)) // Check if the measurement is complete
{
Serial.print(F("BMP280_2 "));
Serial.print(temperature); // Display the results
Serial.print(F("*C "));
Serial.print(pressure);
Serial.print(F("hPa "));
Serial.print(altitude);
Serial.println(F("m"));
}
}