Hi, I have an interesting issue here, I have a touchscreen, from which I can get two values, one X position, one Y position. I wish to use these two values to manipulate a BlinkM I2C RGB LED to make it produce some colours. The colours are (int rgb hex color values):

I wish to have each of the first colors acutated to their full values at the four corners of the pad, and as you move your finger between corners, I wish to morph the colors in the space between the corners, possibly using white as the vale of having your finger at the dead center of the screen.

I believe I will need to design an algorithim or three to use the two input values and to produce each channel of color, which I will send to the I2C bus. I am perfectly comfortable using the I2C setup, I just need to work out how to get to work on the algorithim. Can anyone point me in the right direction?

"Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent di

You want to vary 3 values (r, g, and b) based in 2 input (x and y)? That's going to be tricky.

I'd start with trying to vary the intensity of two of the colors (r and g) as the values (x and y) increase/decrease. When you get that working (the algorithm is easy; the implementation may or may not be), you could work out how to value the third color - perhaps as the inverse of the square root of the sum of the squares of the two values.

This means that the colors in the corners won't be the colors you defined. But, there isn't a linear means of morphing through the colors of the rainbow with those colors in the corners.