In this section, let us look at the commonly used in-built C functions that are used for digital I/O. The following two functions are used for sending a digital signal out via a digital pin. First the digital pin has to be configured in output mode (for sending) in the setup() function:
pinMode(PIN-NUMBER, I/O-MODE)
Let us say we want to send a digital signal via digital Pin 7, then the following line of code will be used:
pinMode(7, OUTPUT)
This is how we configure the digital pin in output mode so that it can send digital signals. The next step is to understand how to actually send a digital signal. For sending a digital HIGH signal the following line of code must be used:
digitalWrite(7, HIGH)
Similarly, for sending a digital LOW signal the following line of code must be used:
digitalWrite(7, LOW)
Note that some peripheral components might need...