B4R Library rAdafruitBMP280 - BMP280 temperature & pressure sensor

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

Usage example:
B4X:
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

  • rAdafruitBMP280.zip
    7.6 KB · Views: 701

derez

Expert
Licensed User
Longtime User
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:

rwblinn

Well-Known Member
Licensed User
Longtime User
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:

derez

Expert
Licensed User
Longtime User
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 ?
 

pappicio

Active Member
Licensed User
Longtime User
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:
Top