How to Use Conditional Statements in Arduino.

By IKTech May 29, 2017

Conditional statement is to check the particular condition or condition of the program. In such a way, it will be difficult to comprehend. Instead, I try to solve the issue with the example. Of course, you have learned somewhat of writing a code in Adudino for quite some time now. In the program we saw in the sixth phase, we saw how to control our LEDs based on the digital input. Well, if I say the same code in the last episode that I first told the Arduino code, what is the status of input? Then I told the Arduino, if the input is high then ignite the LEDs. Arduino will check if my input is high. If it is high then burn the LED. Either keep the LED off. This is the condition. Here we use the two words “if” and “either” with the two words to write the conditional statement. That means we’ll check the condition of the adduinine if () function. Here we will write any conditions in the parentheses. For example, if we say 5 == 5 One thing to say, we should use double “=” sign when checking the condition. Now say 5 is equal to 5? Of course it is equal. That means our condition is true. Then, if we will command the command of if () {} Arduino Arduino will observe it. And if it is not true then we need to write another function else {}. After writing the if () function it is necessary to write it. It does not even write. If you do not have the condition, then if else it will be written in another {arduino}. Hopefully got it done There is no reason to be afraid of those who could not understand yet. For me, I will give you video tutorials every episode. In the video, I tried to put things straight and easy with real projects. I believe that if you watch a video, you can easily get it done. Watch the video:

Hopefully today’s episode you’ve got done well. However, if there is any problem, then tuamana will tell.

Leave a Reply

Your email address will not be published.