user21308: I am making a Soil Analysis system with an Arduino Uno, but I have run into a problem and was wondering if /r/learnprogramming could help!  
The moisture sensor section of my code will not output the data to the Serial Monitor in Arduino 1.7.1 IDE. I am not sure why it's not working. Running the moisture sensor code by itself works, and I just copied and pasted that code into my combined code file since I'll I am running 4 sensors at once with my Arduino Uno.  
These are the four values I need to output data on one baud rate:  

pH value
EC
DHT temperature reading
Moisture Sensor Value
I am currently missing Moisture Sensor Value when I run Combined1.ino  

Here is the Combined1.ino code of the code from four sensors together that's uploaded to the Arduino: 
Combined Code Link
Moisture Sensor Link
Any help would be much appreciated!

user4143: Your second print section will always fail.
You have:
if(millis() - printTime > printInterval)   //Every 800 milliseconds, print a numerical, convert the state of the LED indicator

However, a bit before then you have:
if(millis()-printTime>=printInterval)
{
  printTime=millis();

So millis() - printTime can never be greater than printInterval since you have just set printTime to millis(). So millis() - printTime will always be somewhere between 0 and printInterval - 1.
Consider combining your different printing routines into one single printing routine so you are comparing (and changing) the printTime only once.

21308: <p>I am making a Soil Analysis system with an Arduino Uno, but I have run into a problem and was wondering if /r/learnprogramming could help!  </p>

<p>The moisture sensor section of my code will not output the data to the Serial Monitor in Arduino 1.7.1 IDE. I am not sure why it's not working. Running the moisture sensor code by itself works, and I just copied and pasted that code into my combined code file since I'll I am running 4 sensors at once with my Arduino Uno.  </p>

<p>These are the four values I need to output data on one baud rate:  </p>

<ul>
<li>pH value</li>
<li>EC</li>
<li>DHT temperature reading</li>
<li>Moisture Sensor Value<br>
I am currently missing Moisture Sensor Value when I run Combined1.ino  </li>
</ul>

<p>Here is the Combined1.ino code of the code from four sensors together that's uploaded to the Arduino: 
<a href="https://github.com/trooper5010/Soil-Analysis-System/blob/master/Combined1.ino" rel="nofollow">Combined Code Link</a><br>
<a href="https://github.com/trooper5010/Soil-Analysis-System/blob/master/Moisture_Sensor.ino" rel="nofollow">Moisture Sensor Link</a></p>

<p>Any help would be much appreciated!</p>
 4143: <p>Your second print section will always fail.</p>

<p>You have:</p>

<pre><code>if(millis() - printTime &gt; printInterval)   //Every 800 milliseconds, print a numerical, convert the state of the LED indicator
</code></pre>

<p>However, a bit before then you have:</p>

<pre><code>if(millis()-printTime&gt;=printInterval)
{
  printTime=millis();
</code></pre>

<p>So <code>millis() - printTime</code> can never be greater than <code>printInterval</code> since you have just set <code>printTime</code> to <code>millis()</code>. So <code>millis() - printTime</code> will always be somewhere between <code>0</code> and <code>printInterval - 1</code>.</p>

<p>Consider combining your different printing routines into one single printing routine so you are comparing (and changing) the <code>printTime</code> only once.</p>
