BM1383GLV pressure sensor library
Dependents: BM1383GLV_Hello LazuriteGraph_Hello GR-PEACH_IoT_Platform_HTTP_sample
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:
-
sda SDA pin sdl SCL pin addr slave 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_obj I2C object (instance) addr slave 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 | ( | ) |
float getTemperature | ( | ) |
void initialize | ( | void | ) |
Generated on Wed Jul 13 2022 11:03:57 by 1.7.2