user40030: Can we use just a analog Read without storing it
i hear it it a good practice to take two reads
for better accuracy
example:
// Read extra analog inputs
    for (int i = 0; i < 8; i++)
{
    // Read analog pin to nothing.
        analogRead(i]); // analog-read is not writing to anything 
}


// Read the analog inputs
for (int i = 0; i < length; i++)
{
    // Write the state of the analog pin to the response buffer.
    slave.writeRegisterToBuffer(i, analogRead(analog_pins[address + i]));
}


user40030: how about this ?
// Read the analog inputs
for (int i = 0; i < length; i++)
{
    analogRead(analog_pins[address + i]); // for pre read

    // Write the state of the analog pin to the response buffer.
    slave.writeRegisterToBuffer(i, analogRead(analog_pins[address + i]));
}


40030: <p>Can we use just a analog Read without storing it</p>
<p>i hear it it a good practice to take two reads</p>
<p>for better accuracy</p>
<p>example:</p>
<pre><code>// Read extra analog inputs
    for (int i = 0; i &lt; 8; i++)
{
    // Read analog pin to nothing.
        analogRead(i]); // analog-read is not writing to anything 
}


// Read the analog inputs
for (int i = 0; i &lt; length; i++)
{
    // Write the state of the analog pin to the response buffer.
    slave.writeRegisterToBuffer(i, analogRead(analog_pins[address + i]));
}
</code></pre>
 40030: <p>how about this ?</p>
<pre><code>// Read the analog inputs
for (int i = 0; i &lt; length; i++)
{
    analogRead(analog_pins[address + i]); // for pre read

    // Write the state of the analog pin to the response buffer.
    slave.writeRegisterToBuffer(i, analogRead(analog_pins[address + i]));
}
</code></pre>
