Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84595members
353862posts

BMP280 test please help

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
inneed_indeed
Crewman
Crewman
0 Likes
2
821

BMP280 test please help

I was trying to check if my BMP280 sensor worked by doing the I2C scanner test which worked and the BMP280 test which did not work. I know my wiring is correct which leads me to believe that the code might be incorrect. However, l got the code from a certain website so l am not 100% sure. If someone could give me code that works or sees what's wrong with the code that would be great. Thanks.

 

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_BMP280.h>

#define BMP_SCK (13)
#define BMP_MISO (12)
#define BMP_MOSI (11)
#define BMP_CS (10)

Adafruit_BMP280 bmp; // I2C
//Adafruit_BMP280 bmp(BMP_CS); // hardware SPI
//Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);

void setup() {
Serial.begin(9600);
Serial.println(F("BMP280 test"));

//if (!bmp.begin(BMP280_ADDRESS_ALT, BMP280_CHIPID)) {
if (!bmp.begin()) {
Serial.println(F("Could not find a valid BMP280 sensor, check wiring or try a different address!"));
while (1) delay(10);
}

/* Default settings from datasheet. */
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /* Operating Mode. */
Adafruit_BMP280::SAMPLING_X2, /* Temp. oversampling */
Adafruit_BMP280::SAMPLING_X16, /* Pressure oversampling */
Adafruit_BMP280::FILTER_X16, /* Filtering. */
Adafruit_BMP280::STANDBY_MS_4000); /* Standby time. */
}

void loop() {
Serial.print(F("Temperature = "));
Serial.print(bmp.readTemperature());
Serial.println(" *C");

Serial.print(F("Pressure = "));
Serial.print(bmp.readPressure());
Serial.println(" Pa");

Serial.print(F("Approx altitude = "));
Serial.print(bmp.readAltitude(1013.25)); /* Adjusted to local forecast! */
Serial.println(" m");

Serial.println();
delay(2000);
}


Accepted Solutions
JChamberlain
Schneider Alumni (Retired)
Schneider Alumni (Retired)
0 Likes
0
795

Re: BMP280 test please help

Might be better off raising this on an Arduino forum, I don't think any of it is specific to a SE product.

See Answer In Context

2 Replies 2
AdamWoodland
Commander Commander
Commander
0 Likes
0
814

Re: BMP280 test please help

This is the wrong forum for your question, this one is specific to Geo SCADA.

 

https://community.exchange.se.com/t5/Industry-Automation-and-Control/bd-p/industry-automation-contro... would be a better place to ask

JChamberlain
Schneider Alumni (Retired)
Schneider Alumni (Retired)
0 Likes
0
796

Re: BMP280 test please help

Might be better off raising this on an Arduino forum, I don't think any of it is specific to a SE product.