Temperature controlled RGB LED (Noob programming question)

(This may be based on other question)
Well, I'm working on my first project, A temperature controlled RGB LED (Will be covered with a ping pong ball or as a tree or as a mushroom..etc).
Anyway, I got a problem in programming the RGB with the temperature sensor..
I know how to use a 5mm RGB LED and using it codes (using adafruit's tutorials code) and how to use serial monitor with the temperature sensor (Link of the temperature sensor, here).
So all i want..
Green = between 18 and 24 degrees C
Orange = higher than 24 degrees C and fade to red when more higher
Cyan = fall below 18 degrees C and fade to blue when more colder
Sadly, I'm noob in coding using C/C++.So this is my first project (Because it's more simple than other projects i was thinking about). Also if there is any tips or guides with code i will be thankful.

-Nexusrex

I can recall someone asking this on the forum a few days before...

But my tip: start!
Get an Arduino Uno, a temperature sensor and start with the LED on the uno...

The best way of learning stuff, is to do it. When you eventually don't know what to do next, ask it here. But I (and a lot of us here) ain't going to give plug-and-pray solutions...

If you was to stick to the colour sequence used in a HSV colour wheel but only use the range between 0 degrees (red) to 240 degrees (blue) you could map the temperature reading to the HSV angle to determine your RGB LED colour.
Google for "arduino hsv to rgb code" to find code to convert HSV to RGB.

@C-F-K Well, I know about the sensor and the LED(Checking it and testing it), just all i need is how mix both sketches (replacing the serial monitor with the RGB LED).
@Riva O.O I didn't think that i will enter to HSV colour wheel..Here is a simple code of the LED (by adafruit) Overview | Arduino Lesson 3. RGB LEDs | Adafruit Learning System

And thanks
-Nexusrex

Can you post the code you have now?
And are all 3 pins of the LED connected to analog output pins of the arduino?

All things about the RGB LED are in the page that i putted.
Here is the image of the connection


And here is the code

    /*
    Adafruit Arduino - Lesson 3. RGB LED
    */
     
    int redPin = 11;
    int greenPin = 10;
    int bluePin = 9;
     
    //uncomment this line if using a Common Anode LED
    //#define COMMON_ANODE
     
    void setup()
    {
      pinMode(redPin, OUTPUT);
      pinMode(greenPin, OUTPUT);
      pinMode(bluePin, OUTPUT);  
    }
     
    void loop()
    {
      setColor(255, 0, 0);  // red
      delay(1000);
      setColor(0, 255, 0);  // green
      delay(1000);
      setColor(0, 0, 255);  // blue
      delay(1000);
      setColor(255, 255, 0);  // yellow
      delay(1000);  
      setColor(80, 0, 80);  // purple
      delay(1000);
      setColor(0, 255, 255);  // aqua
      delay(1000);
    }
     
    void setColor(int red, int green, int blue)
    {
      #ifdef COMMON_ANODE
        red = 255 - red;
        green = 255 - green;
        blue = 255 - blue;
      #endif
      analogWrite(redPin, red);
      analogWrite(greenPin, green);
      analogWrite(bluePin, blue);  
    }

(Copied from Adafruit)

-Nexusrex

Well I don't see anything about a temperature input in your code.

When you have a temperature input it shouldn't be to hard to have it outputted to the RGB led. The map() function does most of the work.

int Temperature = //Fill your temperature in here...
int value;


if(Temperature <= 18)
{
value = map(Temperature, 18, 0, 255, 0);
setColor(0, value, 255); //18 degrees is cyan, below it it becomes more blue
}else if(Temperature <= 24)
{
setColor(0, 255, 0); //green
}else{
value = map(Temperature, 24, 50, 102, 0);
setColor(255, value, 0); //24 is orange, from 24 to 50 becomes red
}

Anybody some other idea?

Well, I checked the code, i didn't understand the first line (int Temperature), what you mean with filling the temperature?

About the temperature sensor..
Here is a tutorial that i'm using..But with some editing (The code in the tutorial is containing, when the temperature goes to a number..A LED lights up..So i remove that piece, also some variables are in Portuguese, so i will change them to English)
http://www.andredrobotics.com/en/tutorials/arduino-lm35-temperature-sensor/

-Nexusrex

Now where cooking with peanut oil...

float Temperature = CheckTemp();
int value;

if(Temperature <= 18)
{
value = map(Temperature, 18, 0, 255, 0);
setColor(0, value, 255); //18 degrees is cyan, below it it becomes more blue
}else if(Temperature <= 24)
{
setColor(0, 255, 0); //green
}else{
value = map(Temperature, 24, 50, 102, 0);
setColor(255, value, 0); //24 is orange, from 24 to 50 becomes red
}

Inside of the map() function the float will return as an int, but that won't matter because the analogWrite() function only takes integers.

Well,i finally understood the code in reply #8 after reading it.
Just another questions in the code because i didn't use the IDE very much..
First, i think that i must put the pins variables in the first (int redpin..etc) right or wrong?
Second, must i put any codes from the temperature sensor tutorial (Serial.begin parts..etc)?
Third and final, where can i put the code that you made in reply #8? (of course after the variables..Ok but if there is any others?)

EDIT: I've found a project doing the same as i wanted.. Link: itp.nyu.edu/~bms415/blog/2011/10/stupid-pet-trick/ But using another sensor and lots of RGB LEDs..So can someone help me in changing the code?

-Nexusrex