SensirionSFM3300
Description
This object was introduced in InCore 2.5.
- › Inherits:
Overview
Properties
Methods
Signals
Enumerations
Properties
baseUnit
This property holds the base unit for temperature or pressure measurements.
- › Type:
- › Signal:
baseUnitChanged()
- › Attributes:
Readonly
measureContinuously
This property holds whether to configure the sensor such that it measures continuously.
- › Type:
Boolean
- › Default:
true- › Signal:
measureContinuouslyChanged()
- › Attributes:
Writable
sensorSerialNumber
This property holds the serial number of the attached sensor.
- › Type:
UnsignedInteger
- › Signal:
sensorSerialNumberChanged()
- › Attributes:
Readonly
siPrefix
This property holds the SI prefix for measurements.
- › Type:
- › Signal:
siPrefixChanged()
- › Attributes:
Readonly
timeBase
This property holds the time base unit for measurements.
- › Type:
- › Signal:
timeBaseChanged()
- › Attributes:
Readonly
unit
This property holds the full unit string based on siPrefix, baseUnit and timeBase.
- › Type:
String
- › Signal:
unitChanged()
- › Attributes:
Readonly
value
This property holds the most recently measured value from the sensor.
- › Type:
Float
- › Signal:
valueChanged()
- › Attributes:
Readonly, Requires Polling
Methods
pollValue()
This method polls the value property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
Enumerations
BaseUnit
Name |
Value |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
import InCore.Foundation 2.5
import InCore.IO 2.5
Application {
SensirionSFM3300 {
property real volume: 0
portName: "ttyUSB0"
Polling on value { interval: 25 }
onValueChanged: {
// integrate volume flow to get the total exhaled volume
if( value > 0.5 )
{
if(timer.msecsElapsed > 0)
{
volume += value * timer.msecsElapsed / 60000;
}
timer.restart()
}
else if( value < -0.5 && timer.running )
{
console.log("Exhaled volume", volume)
volume = 0
timer.stop()
}
}
}
Timer { id: timer }
}