
135Chapter 6: Microcontrollers
You can read about many variable types in the Arduino Language Reference.
In the Blink example, we learned that a variable called LED_BUILTIN is used
to refer to pin number 13. This is a variable that is included in the Arduino
IDE. When we create our own variables, we will need to initiate them; this is
covered in the examples that follow:
pinMode(pin, mode)
This sets a digital pin as either an input or an output. The two parameters
needed are the number of the pin and its mode (i.e., INPUT or OUTPUT).
This command is included in the setup so that the pin’s behavior is
determined at the start of the program.
digitalWrite(pin, ...