Component: Barometer BMP280 (101020192) (Grove)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.2 (Release)
Category Grove


Image Barometer BMP280 (101020192) component

Barometric pressure sensor with a I2C bus interface. Pressure range 300 to 1100 hPa. Temperature range -40 to +85 °C.

It must be connected to the correct channel, also make sure that the SDA and SCL are connected to the right pins in flowcode. The barometer sensor must be initialised before it can take any readings. There is also a macro to reset the device. Make sure you know that the readings given for temperature are going to be in °C. Since atmospheric pressure changes with altitude, it can be used to measure the altitude of a location. Pressure and temperature are measured as floating points in flowcode 8 so it’s very accurate. There is a macro to reset the barometer as well so you can take new readings.

Examples

No additional examples


Downloadable macro reference

ReadPressureFloat

Reads the pressure as a floating point value in Bars.

Calls the ReadPressureRaw function and then converts to a meaningful value.

Parameters

This macro has no parameters


Return value

FLOAT


Reset

Resets the device

Parameters

This macro has no parameters


Return value

This call does not return a value


I2C_Read_Register

Reads a byte value from a register on the device

Parameters

BYTE Address


Return value

BYTE


ReadTemperatureFloat

Reads the temperature as a floating point value in °C.

Resultion sets the return bit value and conversion time.

Calls the ReadTemperatureRaw function and then converts to a meaningful value.

Parameters

This macro has no parameters


Return value

FLOAT


Forced_Read

No additional information


Parameters

This macro has no parameters


Return value

This call does not return a value


I2C_Write_Register

Writes a byte value to a register on the device

Parameters

BYTE Address
BYTE Value


Return value

This call does not return a value


Initialise

Starts up the I2C bus and initialises the pressure sensor ready for use.

Returns 1 for a sucessful startup.

Returns 0 for a failed startup or no device detected.

Parameters

This macro has no parameters


Return value

BYTE


Simulation macro reference

This component does not contain any simulation macros


Property reference

Slave Address

This property is of type Fixed list of ints and can be referenced with the variable name SlaveAddress.

No additional information


Channel

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::CHANNEL.

Channel selection

SDA

This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SDA.

Pin used for SDA (data signal)

SCL

This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SCL.

Pin used for SCL (clock signal)

Baud Select

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::BAUD_LIST.

Baud rate option selector

Baud Rate

This property is of type Signed integer and can be referenced with the variable name cal_i2c1::BAUD.

Baud rate to be used

Stop Delay

This property is of type True or false and can be referenced with the variable name cal_i2c1::StopDel.

On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not

a 10ms delay between an I2C stop event and the next I2C start event.


Most modern microcontrollers will not have a problem so this property can be disabled to speed up the

I2C communications.

Compensation

This property is of type Fixed list of ints and can be referenced with the variable name Compensation.

Compensation formulas in double precision floating point or 32 bit fixed point

Humidity Oversampling

This property is of type Fixed list of ints and can be referenced with the variable name HO.

No additional information


Pressure Oversampling

This property is of type Fixed list of ints and can be referenced with the variable name PO.

No additional information


Temperature Oversampling

This property is of type Fixed list of ints and can be referenced with the variable name TO.

No additional information


Mode

This property is of type Fixed list of ints and can be referenced with the variable name Mode.

No additional information


Standby Normal Mode (ms)

This property is of type Fixed list of ints and can be referenced with the variable name Stby.

No additional information


Filter Coefficient

This property is of type Fixed list of ints and can be referenced with the variable name FC.

No additional information


Scope Traces

This property is of type True or false and can be referenced with the variable name cal_i2c1::ScopeTraces.

Selects if the scope traces are automatically generated or not

Console Data

This property is of type True or false and can be referenced with the variable name cal_i2c1::ConsoleData.

Selects if the console data is automatically generated or not

Injector

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::Injector.

No additional information