Motor control
The block controls motors connected to ports M1 and M2.
Parameters:
- 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
The block controls the modules connected to the OUTPUT output ports.
Parameters:
- Port – OUTPUT1, OUTPUT2, OUTPUT3, OUTPUT4.
- 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.
Buzzer
The block controls the operation of the loudspeaker built into the LOFI Brain.
Parameters:
- 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
- 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
Reporting block – returning the value read from the indicated input.
Parameters:
- 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.
Color
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
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.
Parameters:
- Color – color value, scope 0 – 100.
Rectangle
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).
Parameters:
- 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
Displays a number from 0 to 100 (100 is displayed as 00) in color defined by a COLOR block inserted before it.
Parameters:
- Number – number to be displayed, scope 0 – 100.
Show
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
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.