This is an old revision of the document!
Remember to set pins used to output mode.
pinMode (pin[X], OUTPUT);
pin[X] is assuming you have a pin array set up.
From the function name we can assume that it writes some value, and this value will be in the form of 0 and 1. In other words we can say that this function is mainly used to control any device attached to the Pi by assigning value to the pin to which that respective device is attached. For using this function, we have to follow the syntax given below:
digitalWrite(pin, value); To use the digitalWrite() function we need to give it two arguments that are:
Pin: The digital pin number on which the device is connected
Value: the value that is to be assigned to the pin either HIGH or LOW
digitalRead Reads the value from a specified digital pin, either HIGH or LOW. It's syntax reads “ digitalRead(pin) ”.