user3267: I am reading about I2C. On this site:
http://playground.arduino.cc/Main/WireLibraryDetailedReference#endTransmission
It says that endTransmission() can return one of the following status codes:

0: Successful send.
1: Send buffer too large for the twi buffer. This should not happen, as the TWI buffer length set in twi.h is equivalent to the send buffer length set in Wire.h.
2: Address was sent and a NACK received. This is an issue, and the master should send a STOP condition.
3: Data was sent and a NACK received. This means the slave has no more to send. The master can send a STOP condition, or a repeated START.
4: Another twi error took place (eg, the master lost bus arbitration). 

If I attach nothing to my Arduino (or with pull-up resistors to both SDA/SCL), I always get status 2. But how can a NACK (or anything) be received when there is nothing to communicate with? Does it mean something else?
Here is my example code
#include "Wire.h"
void setup() {
  Serial.begin(9600);
  Wire.begin();
}
void loop()  {
  Wire.beginTransmission(42);
  Wire.write(0);
  byte status = Wire.endTransmission();
  Serial.println(status); // always prints 2
}


user612: A NACK is signaled by an acknowledgement slot in which SDA remains high while SCL cycles under control of the master.
Since high is the un-driven state of the pulled-up bus, in the absence of a peripheral at the selected address to positively acknowledge by pulling it down, a NACK condition will passively result.

3267: <p>I am reading about I2C. On this site:</p>

<p><a href="http://playground.arduino.cc/Main/WireLibraryDetailedReference#endTransmission" rel="noreferrer">http://playground.arduino.cc/Main/WireLibraryDetailedReference#endTransmission</a></p>

<p>It says that <code>endTransmission()</code> can return one of the following status codes:</p>

<ul>
<li>0: Successful send.</li>
<li>1: Send buffer too large for the twi buffer. This should not happen, as the TWI buffer length set in twi.h is equivalent to the send buffer length set in Wire.h.</li>
<li>2: Address was sent and a NACK received. This is an issue, and the master should send a STOP condition.</li>
<li>3: Data was sent and a NACK received. This means the slave has no more to send. The master can send a STOP condition, or a repeated START.
4: Another twi error took place (eg, the master lost bus arbitration). </li>
</ul>

<p>If I attach nothing to my Arduino (or with pull-up resistors to both SDA/SCL), I always get status 2. But how can a NACK (or anything) be received when there is nothing to communicate with? Does it mean something else?</p>

<p>Here is my example code</p>

<pre><code>#include "Wire.h"
void setup() {
  Serial.begin(9600);
  Wire.begin();
}
void loop()  {
  Wire.beginTransmission(42);
  Wire.write(0);
  byte status = Wire.endTransmission();
  Serial.println(status); // always prints 2
}
</code></pre>
 612: <p>A <code>NACK</code> is signaled by an acknowledgement slot in which <code>SDA</code> remains high while <code>SCL</code> cycles under control of the master.</p>

<p>Since high is the un-driven state of the pulled-up bus, in the absence of a peripheral at the selected address to positively acknowledge by pulling it down, a <code>NACK</code> condition will <em>passively</em> result.</p>
