Submissions
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 inputs 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.
Button
The button is a digital sensor that differentiates “current flowing” from “no current flowing.” Whether current is flowing, therefore, depends both on the wiring and on whether the button is pushed. You can use the button in two ways:
As a “normally open contact”:
contacts 1 and 3 are connected.
Button pressed: Current is flowing. Button not pressed: No current is flowing
Contacts 1 and 2 are connected.
Call
You can use get mini button status to obtain more information on whether current is flowing through the button or not. If current is flowing, it will return 1, or 0 if no current is flowing.
Query
To query whether the button is in a certain status, use the is button ... block. You can use the drop down menu (small triangle) to select which status to query. This block can be used as a condition.
Ultrasonic sensor
The ultrasonic sensor is used to measure distances.
Call
You can use get ultrasonic sensor distance to obtain information on how far the sensor is from the closest object. The distance is stated in cm.
Query
To query whether the sensor is a certain distance from the closest object, use the is ultrasonic sensor distance ... block. You can use the drop down menu (small triangle) to select how the measured distance should be compared to an 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 measured distance is less than 2 cm.
Color sensor
The color sensor transmits red light, and measures how much of the light is reflected back. The color sensor returns values between 0 and 2000 depending on how strong the reflection is. It is well-suited for detecting previously calibrated colors.
Call
You can use get color sensor value to obtain information on how strongly a surface reflects the light.
Query
To query whether the sensor is in front of a certain color, use the is color sensor value ... block. You can use the drop down menu (small triangle) to select how the measured color value 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 measured color value is less than 1000.
IR track sensor
The infrared track sensor is a digital sensor used for detecting a black track on a white background, and works at a distance of 5 - 30 mm between the sensor and the background.
Call
Get IR track sensor status will return 0 if the sensor does not detect a track. If the sensor detects a track, it will return 1
Query
To query whether the IR track sensor detects a track, compare the current track status with 0 or 1. To do so, use the block is IR track sensor status [] ... . You can use the drop down menu (small triangle) to select how the track status 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 track status is 0
Phototransistor
The phototransistor is a digital sensor that differentiates between light and dark.
Call
Get phototransistor status will return 0 if the sensor does not detect any light. If the sensor detects sufficient light, it will return 1.
Query
To query whether the phototransistor detects light or dark, compare the brightness status with 0 or 1. To do so, use the block is phototransistor status []. You can use the drop down menu (small triangle) to select whether to query light or dark.
One possible use for a phototransistor is in a light barrier, as in this model.
Photoresistor
the resistance of the photoresistor drops when it is exposed to more brightness. The value output by the photoresistor, therefore, is a measurement of brightness.
Call
Get photoresistor value provides information on how bright it is. The smaller the output value, the brighter it is.
Query
To query whether the photoresistor measures a certain brightness value, use the block is photoresistor value [] ... You can use the drop down menu (small triangle) to select how the brightness value 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 brightness value is less than 3000.
NTC resistor
The NTC resistor is a non-binary temperature sensor. Its electrical resistance drops when the temperature increases, and is therefore a measurement for the temperature.
Call
Get NTC resistance [] delivers either a resistance value or the temperature calculated from it. You can select what should be delivered using the drop down menu (small triangle).
Query
To query whether the NTC resistor measures a certain value, use the block is NTC resistance [] [] ... You can use the drop down menu (small triangle) to select what should be compared, and with what comparative operator. 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 less than 20.