user481: I want an I/O pin to return current in a circuit, similarly to the function of ground.
Which of these will achieve what I require?
pinMode(pinnumber, OUTPUT)
digitalWrite(pinnumber, LOW)

or
pinMode(pinnumber, input)


user291: Your first snippet is the correct solution.
pinMode(pinnumber,OUTPUT)
digitalWrite(pinnumber,LOW)

Be careful though, you can only sink up to 6mA or 9mA per pin (as per the documentation ["Input and Output" section], I never tried more). If you need more current, use a transistor (this looks like a good example, you just need to invert the output pin to HIGH).
When the pin is configured as input it is supposed to be high impedance, not what you want.

481: <p>I want an I/O pin to return current in a circuit, similarly to the function of ground.</p>

<p>Which of these will achieve what I require?</p>

<pre><code>pinMode(pinnumber, OUTPUT)
digitalWrite(pinnumber, LOW)
</code></pre>

<p>or</p>

<pre><code>pinMode(pinnumber, input)
</code></pre>
 291: <p>Your first snippet is the correct solution.</p>

<pre><code>pinMode(pinnumber,OUTPUT)
digitalWrite(pinnumber,LOW)
</code></pre>

<p>Be careful though, you can only sink up to 6mA or 9mA per pin (as per the <a href="http://arduino.cc/en/Main/ArduinoBoardDue">documentation</a> ["Input and Output" section], I never tried more). If you need more current, use a transistor (<a href="http://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors">this</a> looks like a good example, you just need to invert the output pin to <code>HIGH</code>).</p>

<p>When the pin is configured as input it is supposed to be high impedance, not what you want.</p>
