Ds18b20 temp sensor question and code help

Hello Everyone,
I just bought a ds18b20 temp sensor to hook up with my arduino uno. I found a code that would work with it. Well I thought I did but the code was for the tmp36 temp sensor and I CANNOT find any code that I can altar to what I want to do with the ds18b20. All im finding is with ones with a lcd screen. I just want 3 LED to light up when a certain temp has been reached. I am not good at writing code but im pretty good to altar one if anyone can please that would be great.

Here I have the code for the tmp36 to give you an idea on how I want my code to work and this code is how I want the LEDs to light up. I know these are two diffrent sensors but if anyone has or know of a code like this but for the ds18b20.

/* Sketch to read temperature and display requirement on RGB LED.
 
 Pin 1 of TMP36 to Arduino 5V power socket
 Pin 2 of TMP36 to Arduino analog 0 socket
 Pin 3 of TMP36 to Arduino GND socket
 
 Red LED Pin to Arduino PIN 9
 GREEN LED Pin to Arduino PIN 10
 Blue LED Pin to Arduino PIN 11
 
 */
 
int red = 9; // the pins for the LED
int green = 10;
int blue = 11;
 
void setup(){
  pinMode(red, OUTPUT); // tell Arduino LED is an output
  pinMode(green, OUTPUT);
  pinMode(blue, OUTPUT);
  Serial.begin(9600);   // activate the serial output connection
}
 
float voltage = 0; // setup some variables
float sensor = 0;
float celsius = 0;
float toocold = 22;
float toohot = 26;
 
void loop()
{              
  sensor = analogRead(0);
  voltage = (sensor*5000)/1024; // convert raw sensor value to millivolts
  voltage = voltage-500;        // remove voltage offset
  celsius = voltage/10;         // convert millivolts to Celsius
 
  Serial.print("Temperature: ");  // these four lines send the temp to the
  Serial.print(celsius,2);        // PC serial monitor.
  Serial.println(" degrees C");
  Serial.println("_ _ _ _ _ _ _ _ _ _ _ _ _ _  ");
 
  if (celsius <= toocold) {      // if statement to turn LED red if
    digitalWrite (green, LOW);   // under minimum temperature
    digitalWrite (red, HIGH);
    digitalWrite (blue, LOW);
  }
 
  else if (celsius >= toohot){    // if statement to turn LED Blue if
    // over max temperature
    digitalWrite (green, LOW);
    digitalWrite (red, LOW);
    digitalWrite (blue, HIGH);
  }
 
  else{                           // in all other cases (ie temp OK)
    digitalWrite (green, HIGH);   // turn the LED Blue
    digitalWrite (red, LOW);
    digitalWrite (blue, LOW);
  }
 
  delay(1000);                  // delay to stop serial send too fast
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

I CANNOT find any code that I can altar to what I want to do with the ds18b20.

Search for ds18b20 arduino

for example: http://www.hobbytronics.co.uk/ds18b20-arduino

Tmz1313: I CANNOT find any code that I can altar to what I want to do with the ds18b20. All im finding is with ones with a lcd screen. I just want 3 LED to light up when a certain temp has been reached. I

The temperatures returned by the DS18B20 are float variables for print to LCD. You just use int instead, and treat them just like the stuff from the other sensor.

Thanks that what I did