Jump to content

Component: Barometer (BMP180) (Environmental): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(19 intermediate revisions by 2 users not shown)
Line 12: Line 12:




==Barometer component==
==Barometer (BMP180) component==
Barometric pressure sensor with a I2C bus interface. Pressure range 300 to 1100 hPa. Temperature range -40 to +85 °C.
Barometric pressure sensor with a I2C bus interface. Pressure range 300 to 1100 hPa. Temperature range -40 to +85 °C.
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Pressure_Sensor_BMP180.fcfx FC_Comp_Source_Pressure_Sensor_BMP180.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Pressure_Sensor_BMP180.fcfx FC_Comp_Source_Pressure_Sensor_BMP180.fcfx]


==Detailed description==
==Detailed description==
Line 19: Line 25:




''No detailed description exists yet for this component''


==Examples==






''<span style="color:red;">No additional examples</span>''


==Downloadable macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPressureFloat'''
|-
| colspan="2" | Reads the pressure as a floating point value in Bars. Calls the ReadPressureRaw function and then converts to a meaningful value.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Reset'''
|-
| colspan="2" | Resets the device&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2C_Read_Register'''
|-
| colspan="2" | Reads a byte value from a register on the device&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadTemperatureFloat'''
|-
| colspan="2" | 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.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Altitude'''
|-
| colspan="2" | Calculates the altitude based on difference between actual pressure and the pressure at the sea level P0=1013.25 hPa. &nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forced_Read'''
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2C_Write_Register'''
|-
| colspan="2" | Writes a byte value to a register on the device&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
''No detailed description exists yet for this component''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
==Examples==
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UpdateAccelerometerData'''
|-
| colspan="2" | Reads from the accelerometer and updates the local XYZ variables. Returns 1 for new data and 0 for no new data&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SimSetCompass'''
|-
| colspan="2" | Allows the XYZ slider values to be set via the simulation&nbsp;
|-
|-
| width="10%" align="center" | [[File:]] -
| width="90%" | X
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:]] -
| width="90%" | Y
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:]] -
| width="90%" | Z
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read_Bearing'''
|-
| colspan="2" | Reads the current sensor compass bearing based on degrees CW from magnetic north. Returns 0-359 where 0 = North, 90 = East, 180 = South, 270 = West Requires the ArcTan floating point function to be available to work correctly. Supported on AVR, 16-bit &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | NumSamples
|-
| colspan="2" | The number of readings to base the bearing on&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Sets up up the communication bus and initialises the accelerometer module.  Returns 0 for success and > 0 for fail.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOSetOutputPin'''
|-
| colspan="2" | Sets the selected digital pin to an output and assigns the output state.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Pin
|-
| colspan="2" | Range: 0-29&nbsp;
|-
| width="10%" align="center" | [[File:]] -
| width="90%" | State
|-
| colspan="2" | Range: 0-1&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTReceive'''
|-
| colspan="2" | Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
''<span style="color:red;">No additional examples</span>''
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleAverage10'''
|-
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023. Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ADCChannel
|-
| colspan="2" | Range: 0, 3-7&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SampleCount
|-
| colspan="2" | Range: 1- 100&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SampleDelay
|-
| colspan="2" | Delay in us between each sample&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireScanBus'''
|-
| colspan="2" | Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIInitialise'''
|-
| colspan="2" | Initialsie the SPI module ready for communications&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireReceiveByte'''
|-
| colspan="2" | Receives a byte from the one wire bus a bit at a time&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CSend'''
|-
| colspan="2" | Transmit a byte using the I2C bus&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | DataOut
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTSend'''
|-
| colspan="2" | Send a byte via the UART module&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
| colspan="2" | Data Byte to send. Range: 0-255&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Altitude===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireGetDeviceCount'''
| width="90%" class="mtx-class-macrohead" | '''Altitude'''
|-
|-
| colspan="2" | Returns the number of devices found by the last ScanBus operation.&nbsp;
| colspan="2" | Calculates the altitude based on difference between actual pressure and the pressure at the sea level P0=1013.25 hPa. &nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | Channel
|-
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Forced_Read===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetPrescaler'''
|-
| colspan="2" | Sets the prescaler for the PWM output&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | Range: 0 - 11&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" | Prescaler
| width="90%" class="mtx-class-macrohead" | '''Forced_Read'''
|-
|-
| colspan="2" | &nbsp;
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Period
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 435: Line 113:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===I2C_Read_Register===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
| width="90%" class="mtx-class-macrohead" | '''I2C_Read_Register'''
|-
|-
| colspan="2" | Enable a PWM output&nbsp;
| colspan="2" | Reads a byte value from a register on the device&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
| width="90%" | Address
|-
|-
| colspan="2" | Range: 0-11&nbsp;
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===I2C_Write_Register===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleArray10'''
| width="90%" class="mtx-class-macrohead" | '''I2C_Write_Register'''
|-
|-
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet&nbsp;
| colspan="2" | Writes a byte value to a register on the device&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ADCChannel
| width="90%" | Address
|-
|-
| colspan="2" | Range: 0, 3-7&nbsp;
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SampleCount
| width="90%" | Value
|-
|-
| colspan="2" | Range: 1- 32&nbsp;
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | SampleDelay
|-
| colspan="2" | Delay in us between each sample&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Samples
|-
| colspan="2" | 10-bit samples returned from the function&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 486: Line 156:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSampleAverage8'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
| colspan="2" | 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.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | ADCChannel
|-
| colspan="2" | Range: 0, 3-7&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SampleCount
|-
|-
| colspan="2" | Range: 1- 100&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SampleDelay
|-
| colspan="2" | Delay in us between each sample&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
Line 514: Line 170:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReadPressureFloat===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''ReadPressureFloat'''
|-
|-
| colspan="2" | Initialise the comms to the Arduino board ready for commands to be sent.&nbsp;
| colspan="2" | Reads the pressure as a floating point value in Bars. Calls the ReadPressureRaw function and then converts to a meaningful value.&nbsp;
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReadTemperatureFloat===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
| width="90%" class="mtx-class-macrohead" | '''ReadTemperatureFloat'''
|-
|-
| colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD&nbsp;
| colspan="2" | 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.&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | EnableMask
|-
| colspan="2" | Range 0-63 or 0b00000 to 0b111111&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Reset===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Reset'''
|-
|-
| colspan="2" | &nbsp;
| colspan="2" | Resets the device&nbsp;
|-
|-
|-
|-
Line 556: Line 210:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | I2C Properties
|-
|-
|-
|-
Line 602: Line 258:
|-
|-
| colspan="2" | 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. &nbsp;
| colspan="2" | 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. &nbsp;
|-
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Sensor Properties
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Line 638: Line 298:
| colspan="2" | &nbsp;
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" | Scope Traces
| width="90%" class="mtx-class-propfolder" | Simulation
|-
| colspan="2" | Selects if the scope traces are automatically generated or not&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Console Data
|-
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | API
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|-
|-
|-

Latest revision as of 14:36, 13 July 2026

Author Matrix TSL
Version 1.1
Category Environmental


Barometer (BMP180) component

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

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Pressure_Sensor_BMP180.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Pressure_Sensor_BMP180.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

Altitude

Altitude
Calculates the altitude based on difference between actual pressure and the pressure at the sea level P0=1013.25 hPa.  
- FLOAT Return


Forced_Read

Forced_Read
 
- VOID Return


I2C_Read_Register

I2C_Read_Register
Reads a byte value from a register on the device 
- BYTE Address
 
- BYTE Return


I2C_Write_Register

I2C_Write_Register
Writes a byte value to a register on the device 
- BYTE Address
 
- BYTE Value
 
- VOID Return


Initialise

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. 
- BYTE Return


ReadPressureFloat

ReadPressureFloat
Reads the pressure as a floating point value in Bars. Calls the ReadPressureRaw function and then converts to a meaningful value. 
- FLOAT Return


ReadTemperatureFloat

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. 
- FLOAT Return


Reset

Reset
Resets the device 
- VOID Return


Property reference

Properties
I2C Properties
Slave Address
 
Channel
Channel selection 
SDA
Pin used for SDA (data signal) 
SCL
Pin used for SCL (clock signal) 
Baud Select
Baud rate option selector 
Baud Rate
Baud rate to be used 
Stop Delay
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.  
Sensor Properties
Compensation
Compensation formulas in double precision floating point or 32 bit fixed point 
Humidity Oversampling
 
Pressure Oversampling
 
Temperature Oversampling
 
Mode
 
Standby Normal Mode (ms)
 
Filter Coefficient
 
Simulation
Simulate Comms
Allows the simulation data to come from the panel GUI or relayed via an injector component.