LOFI Blocks – Robot

Motor control

The block controls motors connected to ports M1 and M2.


  • Port – M1, M2 – socket to which the motor is connected.
  • Direction – FRONT, REAR – the direction of motor rotation.
  • Power – 0-100 – the power with which the engine rotates. Note that the engine must be set to power above about 60 in order for the engine to start.

Controlling OUTPUT1-4

LOFI_Blocks_Robot (2)

The block controls the modules connected to the OUTPUT output ports.


  • Power – 0 – 100 – power set at the output, controlling for example the brightness of the LED diode.

The OUTPUT4 output is connected to the M2 motor control – you can not use them simultaneously (they will interfere with each other).

If Arduino servo control blocks have been used, Arduino switches the pins of outputs to SERVO mode. The outputs can no longer be controlled using the SET OUTPUT blocks. To return to their original state, reset Arduino.


LOFI_Blocks_Robot (4)

The block controls the operation of the loudspeaker built into the LOFI Brain.


  • Status – ON, OFF.

The built-in speaker has a so-called generator so that it can only make a sound of one specific frequency – about 600 Hz.

Reading from the distance sensor

LOFI_Blocks_Robot (6)

  • Reporting block – returning the value in centimeters (in the range 0-100cm) measured by the distance sensor.

If the distance sensor does not detect any obstacle, it returns value 100. This is the limit set in LOFI Blocks, the actual working range of this sensor is about four meters.

Reading from analog inputs INPUT1 – 4

LOFI_Blocks_Robot (5)

Reporting block – returning the value read from the indicated input.


  • Port – INPUT1, INPUT2, INPUT3, INPUT4.

Arduino “does not know” whether any sensor is connected to the input. If we ask it to read from the input to which no sensor is connected, we will always get some reading, but they will usually be some kind of interference, or “heard” from neighboring input.


LOFI_Blocks_Robot (7)

Defining the color of LEDs in RGB:

  • R – red component, scope 0 – 100.
  • G – green component, scope 0 – 100.
  • B – blue component, scope 0 – 100.

Rainbow color

LOFI_Blocks_Robot (8)

Allows you to define the color with just one component. This block is great for generating fluent transitions between colors however, it doesn’t allow for changing the brightness level.


  • Color – color value, scope 0 – 100.


LOFI_Blocks_Robot (9)

Displays a rectangle by defining the coordinates of the upper-left corner, height, and width. The rectangle’s color can be defined by inserting a COLOR block before it (the default color of the rectangle is white).


  • X – horizontal coordinates of the upper-left corner of the rectangle, scope 0 – 7.
  • Y – vertical coordinates of the upper-left corner of the rectangle, scope 0 – 7.
  • Width – width of the rectangle, scope 1 – 8.
  • Height – height of the rectangle, scope 1 – 8.

Display number

LOFI_Blocks_Robot (11)

Displays a number from 0 to 100 (100 is displayed as 00) in color defined by a COLOR block inserted before it.


  • Number – number to be displayed, scope 0 – 100.


LOFI_Blocks_Robot (14)

Displays previously defined objects (rectangles and numbers) on the display. This block has to be always present to display anything on the display.

Clear display

LOFI_Blocks_Robot (13)

Clears all the LEDs on the display. Without this block, any new image will be displayed on top of the previous one. In order to display an image or animation on a blank display, you need to clear the display using this block each time.