EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Posted: 2021-05-19 02:16 AM . Last Modified: 2023-05-03 12:03 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-19 02:16 AM . Last Modified: 2023-05-03 12:03 AM
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);
}
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-20 11:27 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-20 11:27 PM
Might be better off raising this on an Arduino forum, I don't think any of it is specific to a SE product.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-19 03:07 PM . Last Modified: 2022-10-19 01:41 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-19 03:07 PM . Last Modified: 2022-10-19 01:41 AM
This is the wrong forum for your question, this one is specific to Geo SCADA.
https://community.se.com/t5/Industry-Automation-and-Control/bd-p/industry-automation-control_forum would be a better place to ask
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-20 11:27 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-20 11:27 PM
Might be better off raising this on an Arduino forum, I don't think any of it is specific to a SE product.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.
With achievable small steps, users progress and continually feel satisfaction in task accomplishment.
Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.
of