I2C
The I2C sensors described in this section are connected to the TXT 4.0 Controller using a suitable ribbon cable.
The Start each time block
The Start each time block offers the option of running a program when a condition is fulfilled. Therefore, it works similar to a case distinction, but runs not only one time, but rather every time the condition is fulfilled during the entire course of the program. The Start each time block:
Is an abbreviation for the following construct:
You can insert all conditions from this category into the I2C category in the Start each time block.
Note: The program section in the Start each time block should be kept short, and should not contain any blocking calls or endless loops, so that this part of the program can be processed quickly.
Combi sensor
The combi sensor combines the three functions of an acceleration sensor, gyroscope, and compass sensor in one component.
Acceleration sensor
Call
Use get combi sensor acceleration in [] to obtain the acceleration in one spatial direction. You can select the desired spatial direction using the drop down menu (small triangle). The acceleration is indicated in g.
Query
Use the combi sensor acceleration in [] [] ... block to query whether you are measuring a certain acceleration. You can use the drop down menu (small triangle) to select how the acceleration should be compared to the entered value (<, ≤, =, ≠, ≥, >) and what spatial direction should be queried. The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the acceleration in the x direction is greater than 10.
Gyroscope
Call
Use get combi sensor rotation in [] to obtain the rotation in one spatial direction. You can select the desired spatial direction using the drop down menu (small triangle). The rotation is indicated in °/s.
Query
Use the combi sensor rotation in [] [] ... block to query whether you are measuring a certain angular speed. You can use the drop down menu (small triangle) to select how the rotation should be compared to the entered value (<, ≤, =, ≠, ≥, >) and what spatial direction should be queried. The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the rotation in the x direction is greater than 10.
Compass sensor
Call
Use get combi sensor magnetic flux in [] to obtain the magnetic flux in one spatial direction. You can select the desired spatial direction using the drop down menu (small triangle). The magnetic flux is indicated in μT.
Query
Use the combi sensor magnetic flux in [] [] ... block to query whether you are measuring a certain magnetic flux. You can use the drop down menu (small triangle) to select how the magnetic flux should be compared to the entered value (<, ≤, =, ≠, ≥, >) and what spatial direction should be queried. The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the magnetic flux in the x direction is greater than 10.
Environmental sensor
The environmental sensor combines the four functions of an air quality sensor, humidity sensor, barometer, and thermometer in one component.
Air quality sensor
Call
You can use the get environmental sensor air quality as [] block to measure the air quality. You can use the drop down menu (small triangle) to select whether the air quality should be returned as a numerical value (from 0 to 500) or as a text.
Query
Use the environmental sensor air quality [] ... block to query whether you are measuring a certain air quality. You can use the drop down menu (small triangle) to select how the air quality should be compared to the entered value (<, ≤, =, ≠, ≥, >) . The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the air quality is greater than 10.
Barometer
Call
You can use the get environmental sensor air pressure block to measure the air pressure.
Query
Use the environmental sensor air pressure [] ... block to query whether you are measuring a certain air pressure. You can use the drop down menu (small triangle) to select how the air pressure should be compared to the entered value (<, ≤, =, ≠, ≥, >) . The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the air pressure is greater than 10.
Thermometer
Call
You can use the get environmental sensor temperature block to measure the temperature.
Query
Use the environmental sensor temperature [] ... block to query whether you are measuring a certain temperature. You can use the drop down menu (small triangle) to select how the temperature should be compared to the entered value (<, ≤, =, ≠, ≥, >) . The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the temperature is greater than 10.
Humidity sensor
Call
You can use the get environmental sensor humidity block to measure the humidity.
Query
Use the environmental sensor humidity [] ... [] ... block to query whether you are measuring a certain humidity. You can use the drop down menu (small triangle) to select how the humidity should be compared to the entered value (<, ≤, =, ≠, ≥, >) . The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the humidity is greater than 10.