Calculate result in between multiple pre-defined point

Hi! I'm Thomas.

I did my own video light based on Arduino ESP32.

Question :

the light has Color temperature range from 2800-6500K
LED arrangement has 5 Colors

R/G/B/WW/CW

I calibrated the light using spectrometer and got some parameters that I have to use in code.
for EX. R11 G800 B455 WW1023 CW600 (10 bit 1024 levels)

BUT!! if let say I use 2800/4100/5500/6500 or more then it's static preset to choose.

My adjustment will resulting in 2800-6500 range from knob.

Is it possible to calculate something between calibrated point I made like I set it to 3500K then it calculate R/G/B/WW/CW based on 2 closest setting of 2800 and 4100.

Many Thx!!!

A standard approach would be to make table entries for several fixed color temperatures in the range 2800-6500 K and linearly interpolate between the table values. Much more detail here.

jremington:
A standard approach would be to make table entries for several fixed color temperatures in the range 2800-6500 K and linearly interpolate between the table values. Much more detail here.

I searched for example but still not lucky. Could you please provide such sample code or a link?

Example for what?

Post your code, using code tags, and forum members can help fix problems that have come up.

stefankante:
My adjustment will resulting in 2800-6500 range from knob.

Maybe the map function is what you're after?

dougp:
Maybe the map function is what you're after?

Yes, I just found out "MultiMap" fit my need!!! Thanks for reply. Work like charm.