I want to talk now about conditional statements, we've seen this and we have utilized them in detail,
but I want to show you the syntax of doing that now.
Here in Adreno, it's very similar.
The functionality is really the same.
We use it to control the flow of the program.
And I'm going to give you a very simple example on how to use it.
Let's say with a button.
Let's say that you want to know if a button is pressed or not.
OK, and what you want to do is you want your legacy to turn on only if this which is pressed.
OK, so I just said it only if the switch is oppressed.
So let's say that this is my schematic.
I have a button here.
It is connected to an input here.
I can forgive the into an input and I have this pen right here, this one right here, number 13.
Let's say I configured it as an output.
And if I press this, I want this to light.
When I release it, I want it to turn off so we could easily do that with a code like that.
So this is all the absolute code pseudocode, meaning that it's not exactly the same, but this is what
it should look like when you write an if statement.
Now, here it is exactly the same.
So you would write if BOTTEN equals high.
So it means that if I have a valuable gold button and I link this valuable to my input and I see that
if I try to read it, it's giving me a value of hi, I want my lady to be high, meaning if my brother
is oppressed, I want my lady to be turned on.
Otherwise, if I see that my button is actually low, meaning it's released well, meaning my lady will
be low, meaning that my ability will turn up.
So we've seen already if statements and how we can use them before.
But you might ask what is this, why would you say double equals sign?
Well, for comparison, what you need to do if you have an if statement are you are comparing to stuff.
If they are equal to each other, you would need to use a double equals sign.
OK, this is the syntax of Audrina or the CEO of the C++.
You would need to say if BOTTEN equals equals high, so double will be used only if you are using if
statements.
Remember, if you use only one equals sign, your condition will not be evaluated correctly and you
would go to some books in your code.
No, this is a comparison and one equals minus four assignment, meaning my lady, which is that output
page will be assigned to high meaning it will you will write this to this location memory, meaning
that your lady will have a new value.
But here you are comparing to stuff if they are equal to each other.
OK, so your reading button, if button is read low, this is not satisfied and you'll jump here.
If Botten is you read a button and it's low, low equals low.
So this comparison is correct.
So they will have lower it into it.
And since this is connected to it, then this law will go to a low means zero, meaning that your leidy
will be zero and you'll turn off.