PROGRAMMING STRUCTURES "IF"
In brikoblocks there are " programming structures " which allow us to make more complex codes, the most common are " if ", " for ", " while " and " switch ". These allow your code to make decisions, and take action according to conditions, in addition to simplifying the code so you do not have to write many lines, and some things are done automatically. The "structure if " allows a section of the code to work only when a condition is met. The " if " may be related to the word " if ." For example: " If / if " I'm thirsty, I drink water. The same you can do in programming. You can say for example: if the button is pressed, turn on the LEDs. The block to use this cycle you can find it in the menu " logic ":

Y is used as follows:


Comparison operators
These are symbols that are used to compare two values:

By using these operators, the result is always a (true / false ), some examples of using comparison operators can be: 2 == 2 this is true ! 3 = 2 this is true 2 <2 this is false 4 <= 2 this is false 1> 2 this is false 2> = 2 this is true


Tickets and conditioning
The briko input are excellent for use as conditioning when using structures, whether you want the LEDs to light up if you press a button or want the brightness of the LEDs to change according to the distance sensor.The Briko button is one of the most practical for when we want a human to interact and control actions. Let's use the " read ()" with which we return the button number we press, ie, if we press the 3 button function it returns a 3, but pushing any button this function will return a 0. In the following example we will do that when you push the button 1 , the LEDs to be turned blue. The logic is as follows:

Pressing the 1 button function " read ()" returns us 1, as the condition "is met if " it is done within the block of " do " if you press any other button or no, it would not fulfill the condition in the " if " and not accomplish the block " do ".
Example 1:
Let's make a 2 - sound like a piano using the structure " if " buttons and buzzer. We will do that if I press button 1 tap a " DO " and if I press the 2 button tap a " RE " and if any button turns off the horn is pressed.
