B4R Library rAdafruitBMP280 - BMP280 temperature & pressure sensor

This is a wrapper for Adafruit BMP280 library: https://github.com/adafruit/Adafruit_BMP280_Library

Usage example:
Code: Copy
Sub Process_Globals
   Public Serial1 As Serial
   Private bmp As Adafruit_BMP280
End Sub

Private Sub AppStart
   Serial1.Initialize(115200)
   Log("AppStart")
   If bmp.Initialize Then
     Log("Successful")
     Log(bmp.ReadAltitude(1013.25))
     Log(bmp.ReadPressure)
     Log(bmp.ReadTemperature)
   Else
     Log("sensor not found!")
   End If
End Sub
 

Attachments

BMP280 used:
View attachment 52356

To help, just scribbled an i2cscanner - check if the device address can be found --- you might need to unplug / plugin the device and scan again if not found first time.
Wow that was quick solution ! my board looks the same, I checked the address with your scanner, changed the Adafruit library's address to 76 and it works. Thanks !
 
Last edited:
Think it will need another library as this sensor uses different registers & chipid than Adafruit.

Found a generic BMP280 driver here ... but wrapping for B4R seems not that easy :(

So probably better to buy an Adafruit BMP280 and amend the rAdafruitBMP280 library with SPI --- just a few lines to wrap.
 
Last edited:
With WEMOS it does not want to work.
I made the connections through logic converter to let the BMP work with 5v and the WEMOS pins with 3.3v but it is not found.
Any idea ?
 
Hi all, what about humidity? I've read also about humidity read capability for this sensor, I've also searched on some Arduino codes and can confirm about, there will be a possibility to update the library with It also?
Thanks in advances.
Edited:

Is for MBE vetsion
https://forum.arduino.cc/index.php?topic=390732.0

There is a library on?

Okok. Found It, the fact Is that I have One that Is BME/P version so I think It reads pressure and humidity too...
 
Last edited:
Back
Top