BM1383GLV pressure sensor library

Dependents:   BM1383GLV_Hello LazuriteGraph_Hello GR-PEACH_IoT_Platform_HTTP_sample

Embed: (wiki syntax)

« Back to documentation index

BM1383GLV Class Reference

BM1383GLV Class Reference

BM1383GLV pressure sensor example. More...

#include <BM1383GLV.h>

Public Member Functions

 BM1383GLV (PinName sda, PinName scl, int addr=BM1383GLV_DEFAULT_SLAVE_ADDRESS)
 BM1383GLV constructor.
 BM1383GLV (I2C &i2c_obj, int addr=BM1383GLV_DEFAULT_SLAVE_ADDRESS)
 Create a BM1383GLV instance which is connected to specified I2C pins with specified address.
 ~BM1383GLV ()
 BM1383GLV destructor.
void initialize (void)
 Initializa BM1383GLV sensor.
float getPressure ()
 Get pressure.
float getTemperature ()
 Get temerature.

Detailed Description

BM1383GLV pressure sensor example.

 BM1383GLV sensor(I2C_SDA, I2C_SCL);
 Serial pc(USBTX, USBRX);
 
 int main() {
     pc.printf("\nBM1383GLV Pressure sensor library test program.\n");

     while(1) {
         pc.printf("pressure=%7.2f, temperature=%5.3f\n", sensor.getPressure(), sensor.getTemperature());
         wait(0.5);
     }
 }

Definition at line 68 of file BM1383GLV.h.


Constructor & Destructor Documentation

BM1383GLV ( PinName  sda,
PinName  scl,
int  addr = BM1383GLV_DEFAULT_SLAVE_ADDRESS 
)

BM1383GLV constructor.

Parameters:
sdaSDA pin
sdlSCL pin
addrslave address of the I2C peripheral (default: 0xBA)

Definition at line 33 of file BM1383GLV.cpp.

BM1383GLV ( I2C &  i2c_obj,
int  addr = BM1383GLV_DEFAULT_SLAVE_ADDRESS 
)

Create a BM1383GLV instance which is connected to specified I2C pins with specified address.

Parameters:
i2c_objI2C object (instance)
addrslave address of the I2C-bus peripheral (default: 0xBA)

Definition at line 38 of file BM1383GLV.cpp.

~BM1383GLV (  )

BM1383GLV destructor.

Definition at line 43 of file BM1383GLV.cpp.


Member Function Documentation

float getPressure (  )

Get pressure.

Returns:
pressure

Definition at line 73 of file BM1383GLV.cpp.

float getTemperature (  )

Get temerature.

Returns:
temperature

Definition at line 82 of file BM1383GLV.cpp.

void initialize ( void   )

Initializa BM1383GLV sensor.

Configure sensor setting

Definition at line 47 of file BM1383GLV.cpp.