hello i am programming stm32f1 using ide. I ran the mpu6050 sensor with no problems but the adafruit bmp280 sensor shows no value. I am using the bmp280test code inside the arduino. sck is connected to pin B7 and sdi is connected to pin B6 this is the code i use. The code compiles without errors. When I open the serial port, I can't see any text or value. where is the problem i can't find it please help
#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_500); /* 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);
}
ADAFRUİT BMP280 SENSOR
ADAFRUİT BMP280 SENSOR
I will say first that I have not used the most recent Adafruit BMP library; however, I have used a bluepill with an earlier version of BMP without problems.
Maybe this will help:
https://thesolaruniverse.wordpress.com/ ... r-station/
-or-
https://hobbyprojects.home.blog/2019/06 ... %B5%D1%80/
Turn on Google Translate after accepting cookies.
Note: Some BME280 modules already have I2C pull-up resistors included (so should be checked first).
FYI: YouTube also hosts numerous BluePill projects.
Note: I2C Address 0x77 or 0x76
Go to full postMaybe this will help:
https://thesolaruniverse.wordpress.com/ ... r-station/
-or-
https://hobbyprojects.home.blog/2019/06 ... %B5%D1%80/
Turn on Google Translate after accepting cookies.
Note: Some BME280 modules already have I2C pull-up resistors included (so should be checked first).
FYI: YouTube also hosts numerous BluePill projects.
Note: I2C Address 0x77 or 0x76
-
- Posts: 633
- Joined: Thu Dec 19, 2019 1:23 am
Answers: 7
Re: ADAFRUİT BMP280 SENSOR
I will say first that I have not used the most recent Adafruit BMP library; however, I have used a bluepill with an earlier version of BMP without problems.
Maybe this will help:
https://thesolaruniverse.wordpress.com/ ... r-station/
-or-
https://hobbyprojects.home.blog/2019/06 ... %B5%D1%80/
Turn on Google Translate after accepting cookies.
Note: Some BME280 modules already have I2C pull-up resistors included (so should be checked first).
FYI: YouTube also hosts numerous BluePill projects.
Note: I2C Address 0x77 or 0x76
Maybe this will help:
https://thesolaruniverse.wordpress.com/ ... r-station/
-or-
https://hobbyprojects.home.blog/2019/06 ... %B5%D1%80/
Turn on Google Translate after accepting cookies.
Note: Some BME280 modules already have I2C pull-up resistors included (so should be checked first).
FYI: YouTube also hosts numerous BluePill projects.
Note: I2C Address 0x77 or 0x76
Re: ADAFRUİT BMP280 SENSOR
I tried the code in the link you gave, it didn't work again this time arduino -- libraries-- bme280 I changed the 0x76 to 0x77 in the C code and it worked thenk youuu