To set the value of a digital pin in the Arduino programming language, we use the digitalWrite() function. This function takes the following syntax:
digitalWrite(pin, value);
The digitalWrite() function accepts two parameters, where the first one is the pin number and the second is the value to set. We should use either HIGH or LOW when setting the value of a digital pin. The following code shows how to do this:
digitalWrite(LED_ONE, HIGH); delay(500); digitalWrite(LED_ONE, LOW); delay(500);
In the preceding code, we set the pin defined by the LED_ONE constant too HIGH and then pause for half a second. The delay() function in the Arduino programming language pauses the execution of the sketch for a certain amount of time. The time for this function is in milliseconds. After the delay() function we then set the pin defined by the LED_ONE constant too LOW and wait...