LOFI Blocks – Control

Delay – WAIT

LOFI_Blocks_Control (1)

The block that delays the operations in the loop REPEAT for the time specified in milliseconds (hundredths of a second).

Parameters:

  • Delay – value specified in milliseconds. One second is 100 milliseconds.

If we place the WAIT block inside the DRAW loop, it will be ignored during the program execution. The drawing loop is executed with a fixed frequency of 25 times per second and there is no possibility of delaying it.

Condition – IF

LOFI_Blocks_Control (2)

All blocks inside the block IF are executed if the (TRUE) condition specified at the beginning of the block is met. When the condition is not met (FALSE), the blocks inside the IF block will be ignored when the program is executed.

Parameters:

  • CONDITION – it must be a Boolean value – TRUE or FALSE. A condition with a numerical value will result in considering it unfulfilled.

If you want to specify a condition with a numerical value, for example, a reading from a distance sensor, you must use a comparison, eg. “Is the distance sensor reading less than 20”. Then you will get a logical value of TRUE or FALSE.

A double condition IF … ELSE …

LOFI_Blocks_Control (3)

A double condition defining which blocks are to be executed in a situation when the input condition is met (TRUE), and blocks to be executed when the input condition is not met (FALSE).

Parameters:

  • CONDITION – it must be a Boolean value – TRUE or FALSE. A condition with a numerical value will result in considering it unfulfilled.

If you want to specify a condition with a numerical value, for example, a reading from a distance sensor, you must use a comparison, eg. “Is the distance sensor reading less than 20”. Then you will get a logical value of TRUE or FALSE.

Loop REPEAT

LOFI_Blocks_Control (4)

The blocks placed inside the REPEAT loop will be executed by the number of times specified by the parameter.

Parameters:

  • The number of repetitions.

CONSOLE

LOFI_Blocks_Control (5)

The CONSOLE block allows you to display any value in the console built in LOFI Blocks. This allows us to check what is the real value of a variable, a parameter or a condition, thanks to which it is easier to find possible errors in the program.

Parameters:

  • Field ON / OFF – activates the display of data in the console by a given block – so that if we do not need the data in the console at the moment, we can easily turn it off.
  • HEADER – a text value displayed in the console before the colon character. The header allows to describe the value we display in the console, which improves readability when we display several different data in the console.
  • DATA – data to be displayed in the console.