Temperature and RGB LEDs

The RGB leds works by writing analog values to their pins. There are 3 pins, one for Red, one for Green and the last one is for the Blue, hence (RGB).

To have an idea about how things work, see the following simple sketch: (I am using Arduino UNO)

#define RGB_RED  9
#define RGB_GREEN 10
#define RGB_BLUE 11

void setup() {
  analogWrite(RGB_RED, 120);
  analogWrite(RGB_GREEN, 120);
  analogWrite(RGB_BLUE, 120);
}

void loop() {
  
}

I have connected the red pin of the led to pin 9 in arduino, green pin to pin 10 and the blue pin to pin 11. The reason I chose pins 9, 10 and 11 to the RGB led is that they produce PWM signals, not just 0 and 1 values. You are free to use any other PWM pins (marked with '~' on the board). The analogWrite function generates the required PWM according to the supplied value. You can write values in the rang of [0, 255].

If you don't find this explanation good enough for understanding how things work, you can search using the keywords "RGB led arduino" for example. I think you may find this tutorial useful.

Concerning the temperature sensor, I haven't used one yet. However, I think this tutorial greatly covers a lot of aspects of the sensor.

We are here for any further issues.

Regards,
Ahmad.