Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 1 month ago.
BMP280 Library for SPI
Hi there,
I have a problem connecting Adafruit BMP280 pressure sensor to Nucleo F401RE via SPI. I did that successfully using Arduino ADK because I found a library for that.
Is there any similar library on mbed or an example code for that?
Thanks
2 Answers
7 years, 1 month ago.
I found one, but never tried. Have you tried the search function?
https://developer.mbed.org/search/?q=BMP280
7 years, 1 month ago.
Hi,
I created an SPI version library and example code here.
https://developer.mbed.org/users/MACRUM/code/BME280_SPI_Hello/
Thank you so much, I highly appreciate your reply.. I used it with BMP280 and BME280 but I got the same result which is constant values:
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
51.20 degC, 500.04 hPa, 0.00 %
I tried to apply variable pressure and temperature but the values still constant.. And for sure the sensors are working properly because I tested them on Arduino..
Did you try this library before?
Regards
posted by 13 Mar 2017Quote:
Did you try this library before?
Yes, I used this library with Switch Science BME280 breakout. https://international.switch-science.com/catalog/2236/
mbed LPC1768 pin | SSCI BME280 breakout pin |
---|---|
1 (GND) | 5 (GND) |
40 (VOUT) | 6, 7 (Vcore, Vio) |
p5 (mosi) | 3 (SDI) |
p6 (miso) | 1 (SDO) |
p7 (sclk) | 2 (SCK) |
p8 | 4 (CSB) |
Hi, I just quick checked it with Nucleo F401RE and it worked fine.
NUCLEO F401RE pin | SSCI BME280 breakout pin |
---|---|
GND | 5 (GND) |
3V3 | 6, 7 (Vcore, Vio) |
D4 (mosi) | 3 (SDI) |
D5 (miso) | 1 (SDO) |
D3 (sclk) | 2 (SCK) |
D7 | 4 (CSB) |
BME280_SPI sensor(D4, D5, D3, D7); // mosi, miso, sclk, cs
24.71 degC, 1001.36 hPa, 41.59 % 24.70 degC, 1001.36 hPa, 41.57 % 24.68 degC, 1001.37 hPa, 41.56 % 24.65 degC, 1001.37 hPa, 41.53 % 24.64 degC, 1001.34 hPa, 41.54 % 24.63 degC, 1001.29 hPa, 41.56 % 24.62 degC, 1001.26 hPa, 41.59 % 24.60 degC, 1001.33 hPa, 41.60 % 24.60 degC, 1001.30 hPa, 41.60 % 24.57 degC, 1001.35 hPa, 41.61 % 24.56 degC, 1001.36 hPa, 41.63 %posted by 14 Mar 2017