Tuesday, 1 May 2018

GETTING STARTED WITH ARDUINO

Tutorial For Beginners

Using a Pushbutton to Control the LED

Blinking an LED was easy,but i don't think you would stay sane if your desk lamp were to continuously blink while you were trying to read a book. Therefore, you need to learn how to control it.

In this case we are going to use simplest form of sensor available:a pushbutton.

digitalRead() checks to see whether there is any voltage applied to the pin that you specify between parenthesis,and returns a value of HIGH or LOW depending on finding.


The if statement is possibly the most important instruction in a programming language,because it allows the computer to make decisions.After the if keyword, you have to write a question inside the parenthesis, and if the answer or result is true, the first block of code will be executed and if answer or result is false then else part will be executed.

No comments:

Post a Comment