Including 3 sensors

Hi.

I’m begineer in programer, and i have trouble to include 3 sensor in my web page. I’m using a ethernet shiel to do that.

2 sensor was posted in my web page, been then DHT11 and Tension sensor. But the DS18B20 don’t show in web page.

I’ve using this code

#include <SPI.h>
#include <Ethernet.h>

#include <DHT.h>
#define DHTPIN A2     // what pin we're connected the DHT output
#define DHTTYPE DHT11   // DHT 11 
DHT dht(DHTPIN, DHTTYPE);
#include <Wire.h>

#include <OneWire.h>

byte mac[] = { 
  0xFE, 0xA9, 0xE7, 0xD6, 0xE4, 0x95 };

IPAddress ip(192,168,0,153);
EthernetServer server(8081);
//////////////////////
OneWire ds(2);

byte i, ii; //array pointers
byte dev[8] [8]; //device array
byte devpr; //Number of devices present

////////////////////

int pinoentrada;
int tensao;
int I=0;
int soma=0;
int media=0;

void setup() {
dht.begin(); 
Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());


  pinMode(A1,INPUT);


 //Find all of the Onewire devices connected to pin 9
  for (ii = 0; ii < 8; ii++) { //Up to eight devices
    if (!ds.search(dev[ii])){ //if no devices found
      Serial.println("No more devices found! ");
      devpr = ii;
      Serial.print("Number of devices found equal ");
      Serial.println(devpr);
      ds.reset_search();
      delay(250);
      return;
   
//       bits
//        of
//     precision
// 0   -   9
// 1   -  10
// 2   -  11
// 3   -  12

  // For 9 bit precision
      int t_precision = 0;
      ds.select(dev[ii]);    
      ds.write(0x4E);
      // write zero into the alarm registers
      ds.write(0);
      ds.write(0);
      // and write t_precision into the configuration register
      // to select the precision of the temperature
      ds.write(t_precision << 5);
      // Write them to the EEPROM
      ds.write(0x48);
    }
  }



}

void loop() {
 int h = dht.readHumidity();
  int t = dht.readTemperature();
  {
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
         {
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
         
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
                    // add a meta refresh tag, so the browser pulls again every 5 seconds:
          client.println("<meta http-equiv=\"refresh\" content=\"5\">");
          client.println("<title>");
          client.print("Sensores");
          client.println("</title>");
          
          // output the value of temperature and humuidity from DHT
          client.println("<center>");
          client.println("<h1>");
          client.print("Temperatura e Umidade");
          client.println("</h1>");
          client.println("<h2>");
          client.print("");
          client.println("</h2>");
          client.println("<h4>");
          client.print("Temperatura : ");
          client.print(t);
          client.print("<sup>0</sup>");
          client.print("C");
          client.println("
");
          client.print("Umidade : ");
          client.print(h);
          client.print("%");
          client.println("</h4>");
          client.println("</center>");
           
          client.println("</html>");
          break;
         }
      
    // give the web browser time to receive the data
    delay(1);
    
//////////////////////////////////////////////////
    {
 byte present = 0;
  byte data [8] [12];// 8  12
  int16_t raw [8];//8
  float celsius [8] ;//8

  //Print out the device serial numbers
  for( ii = 0; ii < devpr; ii++) { 
    Serial.print("ROM =");
    for( i = 0; i < 8; i++) {
      Serial.write(' ');
      Serial.print(dev[ii][i], HEX);
    }
    Serial.println(""); 
  }
  //Let get some data!
  for( ii = 0; ii < devpr; ii++) { //Select which device
    ds.reset();
    ds.select(dev[ii]);
    ds.write(0x44, 1); //(bilo je 1 sad je 10) start conversion, with parasite power on at the end
    delay(100); // data 750ms is enough, maybe not
    present = ds.reset();
    ds.select(dev[ii]); 
    ds.write(0xBE); // Read Scratchpad
    for ( i = 0; i < 9; i++) { // we need 9 bytes
      data[ii][i] = ds.read();
    }
  }
  //Conversion time...
  // Convert the data to actual temperature
  // because the result is a 16 bit signed integer, it should
  // be stored to an "int16_t" type, which is always 16 bits
  // even when compiled on a 32 bit processor. 
  for( ii = 0; ii < devpr; ii++) {
    raw [ii]= (data[ii][1] << 8) | data[ii][0]; // bilo je 0
     byte cfg = (data[ii][4] & 0x60);
    // at lower res, the low bits are undefined, so let's zero them
    if (cfg == 0x00)      raw[ii] = raw[ii] & ~7;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw[ii] = raw[ii] & ~3; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw[ii] = raw[ii] & ~1; // 11 bit res, 375 ms
    //// default is 12 bit resolution, 750 ms conversion time
    celsius [ii] = (float)raw [ii] / 16.0;
    Serial.print(" Temperature = ");
    Serial.print(celsius [ii]);
    Serial.print(" Celsius, ");
  }
  // listen for incoming clients on the Ethernet
  
   {
          // send a standard http response header
           // the connection will be closed after completion of the response
         
          
         boolean currentLineIsBlank = true;
          {
          
          
          
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html><title>Sensores</title>");
          client.println("<font face = arial>");
          client.println("<body BGCOLOR='#FFFFFF'>");
          client.println("<h1 style='text-align: center;'></h1>");
          
          
         
          client.print("<hr><font size=+2 center color=#000014>Temperatura Entrada:  <b>");
          client.print(celsius [0]);
          client.println("&degC</b></font></hr>");
          client.print("<hr><font size=+2 center color=#000014> Temperatura Saida:   <b>");
          client.print(celsius [1]);
          client.println("&degC</b></font></td></hr>");
          client.print("<hr><font size=+2 center  <b>");
          client.println ("<html><head> <meta http-equiv='refresh' content='5'></head><body><center>");
          
      }    
           
      
          break;
          
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        } 
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      delay(1);
    }
    }
}
}
    }
//////////////////////////////////////////////////
{
Serial.println(analogRead(A1));



  


 client.println("<center><p><h1></h1></p><center><hr>
");
  
         

client.println();
// auto reload webpage every 5 second
client.println("<META HTTP-EQUIV=REFRESH CONTENT=5 URL=>");

// webpage title
client.println("<center><h1>Medidor de Tensao</h1><center>
");
// read analog pin 1 for the value of photocell

client.print("<p><h2> Tensao = ");
client.println((analogRead(A1) /4.456 ));
client.println("</font></h2></p>");

  
  delay (1000);

  }



    }
    // give the web browser time to receive the data
   
    // close the connection:
    client.stop();
    Serial.println("client disconnected");
  
    

}
}
    if (!ds.search(dev[ii])){ //if no devices found

That comment is wrong. The code says “If this particular device is not found…”

  {
  // listen for incoming clients

{What’s} {with} {the} {useless} {curly} {braces} {?}

    delay(100); // data 750ms is enough, maybe not

So, you figure, being impatient, that waiting 1/8th as long as needed will be enough?

After sending the closing tag, why do you bother (trying to) send more data?

You REALLY need to pay attention to what curly braces are needed and which of the many useless ones you should get rid of.

You REALLY need to learn what Tools + Auto Format does, and use it regularly.

You should replace all client.print() calls, temporarily, with Serial.print() calls, and see if what you are currently sending to the client makes sense. Hint: It does not.

Ok.

So how can I show the third sensor?

Because two of them, already show.

I think that is an easy problem. But because I'm a beginner, I cannot figure out.

Thank's