for(int i=0;i<9;i++) //sort the analog from small to large
{
for(int j=i+1;j<10;j++)
{
if(buf[i]>buf[j])
{
temp=buf[i];
buf[i]=buf[j];
buf[j]=temp;
}
}
}
That's a pretty inefficient sort. The outer statement should be a while statement that monitors a flag that indicates whether or not any swaps took place. Your code will take just as long to sort an array that is in decreasing order as it will to sort one that is in increasing order (one that is already sorted).
When presented with a array that is already sorted, only one pass should be needed to discover that.
#define DHT11PIN A1 //DHT11 Pin A1
#define SensorPin 0 //pH meter Analog output to Arduino Analog Input 0
Adjacent pins - one referred to as 0 and one referred to as A1. Why?
//Turn on Green Led if Temperature Less than 80
if(currentTemp0 < 79)
digitalWrite(greenLed, HIGH);
if(currentTemp0 < 79)
digitalWrite(redLed, LOW);
The code does not do what the comment says. If you are going to have useless comments, you must make them match the code (or vice versa).
Using curly braces would allow you to get rid of one if statement.