temperature sensor

hi everyone
i have two temperature sensor
how can i do to use two temperature sensor on the same arduino

my code only use one temperature sensor
this is my code

#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup(void)
{
Serial.begin(9600);
Serial.println(“Temperature Sensor”);
sensors.begin();
}

void loop(void)
{
sensors.requestTemperatures();
Serial.println(sensors.getTempCByIndex(0));

delay(1000);
}

how can i modify the code to conform it.
please help me :~

Hi dapingQ,

with the code of the library come several examples, including a multi-sensor example called “multiple”. check that code…

I found the best resource was Hacktronics

http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html

A simple way would be to wire up another sensor on the bus, connecting the three legs of the new sensor to the same three legs on the old. Then add this code:

Serial.println(sensors.getTempCByIndex(1));

You won't know without experimenting which sensor is which, so ultimately you'll need to work with sensor addresses. Some additional prints to indicate which sensor's temp is being displayed would be nice too, but the above will get you started with multiples.