Reference.PinMode History

Show minor edits - Show changes to markup

May 07, 2012, at 06:07 PM by David A. Mellis -
Changed lines 6-7 from:

As of Arduino 1.0.1, it is possible to use the internal pullup resistors with the mode INPUT_PULLUP.

to:

As of Arduino 1.0.1, it is possible to enable the internal pullup resistors with the mode INPUT_PULLUP. Additionally, the INPUT mode explicitly disables the internal pullups.

March 28, 2012, at 03:04 PM by Scott Fitzgerald -
Changed lines 14-15 from:
to:

mode: INPUT, OUTPUT, or INPUT_PULLUP. (see the digital pins page for a more complete description of the functionality.)

Changed line 47 from:
to:
February 25, 2012, at 09:49 PM by Scott Fitzgerald -
Changed lines 18-19 from:

[@

to:
Changed lines 35-36 from:

@]

to:
February 25, 2012, at 09:46 PM by Scott Fitzgerald - adding INPUT_PULLUP for 1.0.1
Changed lines 12-13 from:

mode: either INPUT or OUTPUT

to:
Deleted line 44:
September 17, 2010, at 05:07 PM by David A. Mellis -
Changed lines 38-39 from:

The analog input pins can be used as digital pins, referred to as numbers 14 (analog input 0) to 19 (analog input 5).

to:

The analog input pins can be used as digital pins, referred to as A0, A1, etc.

February 21, 2009, at 10:15 PM by David A. Mellis -
Deleted line 40:
Added lines 44-45:
February 21, 2009, at 10:12 PM by David A. Mellis -
Changed line 41 from:
to:
Changed lines 43-44 from:
to:
February 21, 2009, at 10:12 PM by David A. Mellis -
Changed lines 10-13 from:

pin: the number of the pin whose mode you wish to set. (int)

mode: either INPUT or OUTPUT.

to:

pin: the number of the pin whose mode you wish to set

mode: either INPUT or OUTPUT

February 21, 2009, at 10:11 PM by David A. Mellis -
Changed lines 1-2 from:

pinMode(pin, mode)

to:

pinMode()

Added lines 6-8:

Syntax

pinMode(pin, mode)

October 04, 2008, at 01:50 PM by David A. Mellis -
Changed lines 4-5 from:

Configures the specified pin to behave either as an input or an output. See the reference page below.

to:

Configures the specified pin to behave either as an input or an output. See the description of digital pins for details.

February 14, 2008, at 04:28 AM by David A. Mellis -
Changed line 38 from:
to:
February 14, 2008, at 04:28 AM by David A. Mellis -
Changed lines 38-39 from:
  • Description of the pins on an Arduino board
  • analog pins
to:
January 19, 2008, at 04:39 PM by David A. Mellis - changing analog pins link to playground.
Changed line 39 from:
to:
  • analog pins
January 18, 2008, at 07:32 PM by Paul Badger -
Changed lines 35-36 from:

The analog input pins can be used as digital pins w/ numbers 14 (analog input 0) to 19 (analog input 5).

to:

The analog input pins can be used as digital pins, referred to as numbers 14 (analog input 0) to 19 (analog input 5).

January 18, 2008, at 04:14 PM by David A. Mellis -
Deleted lines 8-9:

valid pin numbers on most boards are 0 to 19, valid pin numbers on the Mini are 0 to 21. Pins 0 to 13 refer to the digital pins and pins 14 to 19 refer to the analog pins, when using the digitalWrite and pinMode commands.

Added lines 33-36:

Note

The analog input pins can be used as digital pins w/ numbers 14 (analog input 0) to 19 (analog input 5).

January 18, 2008, at 06:23 AM by Paul Badger -
Changed lines 4-5 from:

Configures the specified pin to behave either as an input or an output.

to:

Configures the specified pin to behave either as an input or an output. See the reference page below.

Changed lines 7-8 from:

pin: the number of the pin whose mode you want to set. (int)

to:

pin: the number of the pin whose mode you wish to set. (int)

valid pin numbers on most boards are 0 to 19, valid pin numbers on the Mini are 0 to 21. Pins 0 to 13 refer to the digital pins and pins 14 to 19 refer to the analog pins, when using the digitalWrite and pinMode commands.

Added line 37:
January 11, 2008, at 06:40 PM by David A. Mellis -
Deleted line 5:
Changed lines 9-10 from:

mode: either INPUT or OUTPUT. (int)

to:

mode: either INPUT or OUTPUT.

Deleted lines 32-53:

Pins Configured as INPUT

Arduino (Atmega) pins default to inputs, so they don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs are said to be in a high-impedance state. One way of explaining this is that input pins make extremely small demands on the circuit that they are sampling, say equivalent to a series resistor of 100 Megohms in front of the pin. This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a capacitive touch sensor.

Often it is useful however, to steer an input pin to a known state if no input is present. This can be done by adding a pullup (resistor to VCC), or pulldown resistor (resistor to ground) on the input, with 10K being a common value.

There are also convenient 20K pullup resistors built into the Atmega chip that can be accessed from software. These built-in pullup resistors are accessed in the following manner.

pinMode(pin, INPUT);           // set pin to input
digitalWrite(pin, HIGH);       // turn on pullup resistors

Note that the pullup resistors provide enough current to dimmly light an LED connected to a pin that has been configured as an input. If LED's in a project seem to be working, but very dimmly, this is likely what is going on, and you have forgotten to use pinMode to change the pins to outputs.

Pins Configured as OUTPUT

Pins configured as OUTPUT with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can source (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids, or motors.

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately. For this reason it is a good idea to connect OUTPUT pins to other devices with 470Ω or 1k resistors.

Added line 34:
  • Description of the pins on an Arduino board
Deleted line 37:
December 03, 2007, at 04:52 AM by Paul Badger -
December 03, 2007, at 04:50 AM by Paul Badger -
December 03, 2007, at 04:49 AM by Paul Badger -
Changed lines 47-49 from:
to:

Note that the pullup resistors provide enough current to dimmly light an LED connected to a pin that has been configured as an input. If LED's in a project seem to be working, but very dimmly, this is likely what is going on, and you have forgotten to use pinMode to change the pins to outputs.

November 18, 2007, at 08:01 PM by Paul Badger -
Changed lines 38-39 from:

Often it is useful however, to steer an input pin to a known state if no input is present. This can be done by adding a pullup (resistor to VCC), or pulldown resistor(resistor to ground) to the input, with 10K being a common value.

to:

Often it is useful however, to steer an input pin to a known state if no input is present. This can be done by adding a pullup (resistor to VCC), or pulldown resistor (resistor to ground) on the input, with 10K being a common value.

Changed lines 50-51 from:

Pins configured as OUTPUT with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can sorce (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids, or motors.

to:

Pins configured as OUTPUT with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can source (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids, or motors.

November 04, 2007, at 03:55 AM by Paul Badger -
Changed lines 38-39 from:

Often it is useful however, to steer an input pin to a known state if no input is present. This can be done by adding a pullup (resistor to VCC), or pulldown (resistor to ground) resistor to the input, with 10K being a common value.

to:

Often it is useful however, to steer an input pin to a known state if no input is present. This can be done by adding a pullup (resistor to VCC), or pulldown resistor(resistor to ground) to the input, with 10K being a common value.

June 10, 2007, at 03:39 AM by Paul Badger -
Changed line 55 from:
to:
June 10, 2007, at 03:39 AM by Paul Badger -
Changed line 55 from:
to:
June 10, 2007, at 03:39 AM by Paul Badger -
Added line 55:
June 10, 2007, at 03:37 AM by Paul Badger -
Changed lines 34-35 from:

Pins Configured as Inputs

to:

Pins Configured as INPUT

Changed lines 48-53 from:

Pins Configured as Outputs

Pins configured as outputs with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can sorce (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids, or motors.

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately. For this reason it is a good idea to connect output pins with 470Ω or 1k resistors.

to:

Pins Configured as OUTPUT

Pins configured as OUTPUT with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can sorce (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids, or motors.

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately. For this reason it is a good idea to connect OUTPUT pins to other devices with 470Ω or 1k resistors.

June 10, 2007, at 03:34 AM by Paul Badger -
Changed lines 52-53 from:

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately.

to:

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately. For this reason it is a good idea to connect output pins with 470Ω or 1k resistors.

May 22, 2007, at 04:04 AM by Paul Badger -
Changed lines 36-37 from:

Arduino (Atmega) pins default to inputs, so don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs are said to be in a high-impedance state. One way of explaining this is that input pins make extremely small demands on the circuit that they are sampling, say equivalent to a series resistor of 100 Megohms in front of the pin. This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a capacitive touch sensor.

to:

Arduino (Atmega) pins default to inputs, so they don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs are said to be in a high-impedance state. One way of explaining this is that input pins make extremely small demands on the circuit that they are sampling, say equivalent to a series resistor of 100 Megohms in front of the pin. This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a capacitive touch sensor.

May 17, 2007, at 07:36 PM by Paul Badger -
Added line 56:
May 17, 2007, at 07:34 PM by Paul Badger -
Deleted lines 56-58:
May 17, 2007, at 07:33 PM by Paul Badger -
Changed lines 50-51 from:

Pins configured as outputs with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can sorce (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids or motors.

to:

Pins configured as outputs with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can sorce (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids, or motors.

May 17, 2007, at 07:30 PM by Paul Badger -
Changed lines 50-51 from:

Pins configured as outputs with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can provide up to 40 mA (milliamps) to other devices. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids or motors.

to:

Pins configured as outputs with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can sorce (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids or motors.

May 17, 2007, at 07:28 PM by Paul Badger -
Changed lines 38-39 from:

Often it is useful however to steer an input pin to a known state if no input is present. This can be done by adding a pullup (resistor to VCC) or pulldown (resistor to ground) resistor to the input, with 10K being a common value.

to:

Often it is useful however, to steer an input pin to a known state if no input is present. This can be done by adding a pullup (resistor to VCC), or pulldown (resistor to ground) resistor to the input, with 10K being a common value.

May 17, 2007, at 07:27 PM by Paul Badger -
Changed lines 36-37 from:

Arduino (Atmega) pins default to inputs, so don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs are said to be in a high-impedance state. One way of explaining this is that input pins make extremely small demands on the circuit that they are sampling, say equivalent to a series resistor of 100 Megohms in front of the pin. This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a touch sensor.

to:

Arduino (Atmega) pins default to inputs, so don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs are said to be in a high-impedance state. One way of explaining this is that input pins make extremely small demands on the circuit that they are sampling, say equivalent to a series resistor of 100 Megohms in front of the pin. This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a capacitive touch sensor.

May 17, 2007, at 07:26 PM by Paul Badger -
Changed lines 36-40 from:

Arduino (Atmega) pins default to inputs, so don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs have an extremely high input impedance (~100 Megohm). This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a touch sensor.

Often it is useful however to steer an input pin to a known state, if no input is present. This can be done by adding a pullup (resistor to VCC) or pulldown (resistor to ground) resistor to the input, with 10K being a common value.

to:

Arduino (Atmega) pins default to inputs, so don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs are said to be in a high-impedance state. One way of explaining this is that input pins make extremely small demands on the circuit that they are sampling, say equivalent to a series resistor of 100 Megohms in front of the pin. This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a touch sensor.

Often it is useful however to steer an input pin to a known state if no input is present. This can be done by adding a pullup (resistor to VCC) or pulldown (resistor to ground) resistor to the input, with 10K being a common value.

May 17, 2007, at 06:50 PM by Paul Badger -
Changed lines 53-54 from:

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, either/or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately.

to:

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately.

May 17, 2007, at 06:49 PM by Paul Badger -
Changed lines 44-45 from:

pinMode (pin, INPUT); // set pin to input digitalWrite (pin, HIGH); // turn on pullup resistors

to:

pinMode(pin, INPUT); // set pin to input digitalWrite(pin, HIGH); // turn on pullup resistors

Added lines 49-54:

Pins Configured as Outputs

Pins configured as outputs with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can provide up to 40 mA (milliamps) to other devices. This is enough current to brightly light up an LED (don't forget the series resistor), or run many sensors, for example, but not enough current to run most relays, solenoids or motors.

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, either/or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately.

May 17, 2007, at 06:39 PM by Paul Badger -
Changed lines 36-37 from:

Arduino (Atmega) pins default to inputs, so don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs have an extremely high input impedance (~100 Megohm). This means that it takes very little current to move the input pin from one state to another and can make the pins useful for such tasks as capacitive sensing.

to:

Arduino (Atmega) pins default to inputs, so don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs have an extremely high input impedance (~100 Megohm). This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a touch sensor.

May 17, 2007, at 06:38 PM by Paul Badger -
Changed lines 16-17 from:
 [@
to:

[@

Changed lines 34-36 from:

configures pin number 13 to work as an output pin.

to:

Pins Configured as Inputs

Arduino (Atmega) pins default to inputs, so don't need to be explicitly declared as inputs with pinMode(). Pins configured as inputs have an extremely high input impedance (~100 Megohm). This means that it takes very little current to move the input pin from one state to another and can make the pins useful for such tasks as capacitive sensing.

Often it is useful however to steer an input pin to a known state, if no input is present. This can be done by adding a pullup (resistor to VCC) or pulldown (resistor to ground) resistor to the input, with 10K being a common value.

There are also convenient 20K pullup resistors built into the Atmega chip that can be accessed from software. These built-in pullup resistors are accessed in the following manner.

pinMode (pin, INPUT);           // set pin to input
digitalWrite (pin, HIGH);       // turn on pullup resistors

January 13, 2006, at 12:36 AM by 82.186.237.10 -
Added lines 40-42:
December 28, 2005, at 10:45 PM by 82.186.237.10 -
Changed lines 8-11 from:

pin (int): the number of the pin whose mode you want to set.

mode (int): either INPUT or OUTPUT

to:

pin: the number of the pin whose mode you want to set. (int)

mode: either INPUT or OUTPUT. (int)

December 28, 2005, at 10:44 PM by 82.186.237.10 -
Changed lines 1-6 from:

pinMode

pinMode(int pin, int mode)

to:

pinMode(pin, mode)

Changed lines 8-11 from:

pin: the number of the pin whose mode you want to set

mode: either INPUT or OUTPUT

to:

pin (int): the number of the pin whose mode you want to set.

mode (int): either INPUT or OUTPUT

December 28, 2005, at 10:42 PM by 82.186.237.10 -
Added line 21:
December 28, 2005, at 10:42 PM by 82.186.237.10 -
Changed line 7 from:

What it does

to:

Description

Changed lines 11-17 from:

What parametres does it take

you need to specify the number of the pin you want to configure followed by the word INPUT or OUTPUT.

This function returns

nothing

to:

Parameters

pin: the number of the pin whose mode you want to set

mode: either INPUT or OUTPUT

Returns

None

December 10, 2005, at 05:33 PM by 62.255.32.10 -
Changed lines 3-6 from:
to:
pinMode(int pin, int mode)
Changed lines 14-17 from:
pinMode(ledPin, OUTPUT);      // sets the digital pin as output
to:
December 10, 2005, at 05:31 PM by 62.255.32.10 -
Added line 11:

[@

Changed lines 13-14 from:
to:

@]

December 10, 2005, at 05:30 PM by 62.255.32.10 -
Added lines 11-12:

pinMode(ledPin, OUTPUT); // sets the digital pin as output

December 10, 2005, at 05:28 PM by 62.255.32.10 -
Changed lines 9-11 from:

you need to specify the number of the pin y ou want to configure followed by the word INPUT or OUTPUT.

to:

you need to specify the number of the pin you want to configure followed by the word INPUT or OUTPUT.

December 10, 2005, at 05:26 PM by 62.255.32.10 -
Changed lines 5-7 from:

Configures the specified pin to behave like an input or an output.

to:

Configures the specified pin to behave either as an input or an output.

December 03, 2005, at 08:13 PM by 213.140.6.103 -
Changed lines 10-11 from:

ou want to configure followed by the word INPUT or OUTPUT.

to:

ou want to configure followed by the word INPUT or OUTPUT.

December 03, 2005, at 08:13 PM by 213.140.6.103 -
Changed lines 16-17 from:
 [@int ledPin = 13;                 // LED connected to digital pin 13
to:
 [@

int ledPin = 13; // LED connected to digital pin 13

December 03, 2005, at 08:12 PM by 213.140.6.103 -
Changed lines 16-17 from:

int ledPin = 13; // LED connected to digital pin 13

to:
 [@int ledPin = 13;                 // LED connected to digital pin 13
Changed lines 29-30 from:

}

to:

} @]

December 03, 2005, at 08:12 PM by 213.140.6.103 -
Changed line 36 from:
to:
November 27, 2005, at 05:41 PM by 81.154.199.248 -
Changed lines 16-17 from:

@@int ledPin = 13; // LED connected to digital pin 13

to:

int ledPin = 13; // LED connected to digital pin 13

November 27, 2005, at 05:41 PM by 81.154.199.248 -
Changed lines 29-30 from:

}@@

to:

}

November 27, 2005, at 05:40 PM by 81.154.199.248 -
Deleted line 17:
Deleted line 18:
Deleted line 19:
Deleted line 20:
Deleted line 23:
November 27, 2005, at 05:40 PM by 81.154.199.248 -
Changed lines 16-18 from:

[@int ledPin = 13; // LED connected to digital pin 13

to:

@@int ledPin = 13; // LED connected to digital pin 13

Changed lines 34-35 from:

}@]

to:

}@@

November 27, 2005, at 05:26 PM by 81.154.199.248 -
Added line 18:
Added line 20:
Added line 22:
Added line 24:
Added line 28:
November 27, 2005, at 05:26 PM by 81.154.199.248 -
Changed lines 16-19 from:

[@

int ledPin = 13; // LED connected to digital pin 13

to:

[@int ledPin = 13; // LED connected to digital pin 13

Changed lines 29-31 from:

} @]

to:

}@]

November 27, 2005, at 05:17 PM by 81.154.199.248 -
Changed lines 5-7 from:

Configures the speficied pin to behave like an input or an output.

to:

Configures the specified pin to behave like an input or an output.

November 27, 2005, at 05:17 PM by 81.154.199.248 -
Changed lines 16-17 from:

[=

to:

[@

Changed lines 32-33 from:

=]

to:

@]

November 27, 2005, at 05:13 PM by 81.154.199.248 -
Changed lines 16-17 from:

@@int ledPin = 13; // LED connected to digital pin 13

to:

[= int ledPin = 13; // LED connected to digital pin 13

Changed lines 30-31 from:

}@@

to:

} =]

November 27, 2005, at 05:10 PM by 81.154.199.248 -
Changed lines 16-17 from:

[@int ledPin = 13; // LED connected to digital pin 13

to:

@@int ledPin = 13; // LED connected to digital pin 13

Changed lines 29-30 from:

}@]

to:

}@@

November 27, 2005, at 05:05 PM by 81.154.199.248 -
Changed lines 16-18 from:

[@ int ledPin = 13; // LED connected to digital pin 13

to:

[@int ledPin = 13; // LED connected to digital pin 13

Changed lines 29-32 from:

}

@]

to:

}@]

November 27, 2005, at 05:03 PM by 81.154.199.248 -
Changed lines 16-17 from:

pinMode(13,OUTPUT)

to:
int ledPin = 13;                 // LED connected to digital pin 13

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(1000);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(1000);                  // waits for a second
}

November 27, 2005, at 04:55 PM by 81.154.199.248 -
Changed line 22 from:
  • [[digitalWrite]
to:
November 27, 2005, at 04:55 PM by 81.154.199.248 -
Changed line 4 from:
What it does
to:

What it does

Changed line 8 from:
What parametres does it take
to:

What parametres does it take

Changed line 12 from:
This function returns
to:

This function returns

Changed line 15 from:
Example
to:

Example

Changed lines 21-23 from:
See also
  • {{digitalWrite}}
  • {{digitalRead}}
to:

See also

November 27, 2005, at 04:54 PM by 81.154.199.248 -
Added lines 1-23:

pinMode

What it does

Configures the speficied pin to behave like an input or an output.

What parametres does it take

you need to specify the number of the pin y ou want to configure followed by the word INPUT or OUTPUT.

This function returns

nothing

Example

pinMode(13,OUTPUT)

configures pin number 13 to work as an output pin.

See also
  • {{digitalWrite}}
  • {{digitalRead}}

Share