How it works...
We will start by defining a Led variable and setting it to represent pin 13 of the Arduino. By invoking the pinMode function, the Led variable will be indicated as the output pin, that is, it will be connected to an output device for display or to do some task.
Within the loop function, we will invoke the digitalWrite method to send a HIGH signal to variable Led. By doing so, the LED that is connected to output pin 13 will be switched on. Thereafter, we will introduce a time delay of 1,000 milliseconds.
Once more, we will invoke the digitalWrite method and send a LOW signal, this time to variable Led. As a result, the LED connected to output pin 13 will be switched off. Again, we will introduce a delay of 1,000 milliseconds. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access