User manual

int green, blue, red ;
if (val <= 10 & val >= -20)
blue = map(val, -20, 10, 255, 0);
else blue = 0;
if (val >= 10 & val <= 40)
green = map(val, 10, 40, 255, 0);
else if (val >= -20 & val < 10) green = map(val, -20, 10, 0, 255);
else green = 0;
if (val > 10 & val <= 40) red = map(val, 10, 40, 0, 255);
else red = 0;
analogWrite(RED, red);
analogWrite(GREEN, green);
analogWrite(BLUE, blue);
}
Adjustment of the LED brightnesses is done in the function rgbTemp(). The map-
command will convert the values into the matching byte values (0-255) and output
them at the LED. Blue means particularly cold temperature; it influences the range
of 20 °C to +10 °C. Green is involved in the entire temperature range, but is
strongest at value 10 °C. Red will only start at a value of +10 °C and has its maxi-
mum at +40 °C. This provides an intuitive colour code that suggests the current
temperature in addition to the more precise display on the serial monitor.
TCP SERVER