The lighting of our product is super important as it is one of the key visual features. Therefore we wanted to utilize our LED's in an interesting fashion. We wanted our lighting to be dynamic when our product is blossoming, while also having the colors be defined by the user in NodeRed.
What we came up with for our prototype is a function that smoothly changes between 2 colors that have been defined by the user. To accomplish this we had to go back to our color theory and use one of our favorite color models, HSV!
We have made a function that lerps through the different variables, Hue, Saturation and Value. The user defines a color based on these values in NodeRed and the Arduino does the rest.
One of the important parts of our code is that it is non-blocking, meaning you can update the colors real time and the Arduino changes accordingly. Every time NodeRed updates the colors on the Arduino also update.
This script will also let us as developers create presets to simulate weather for example. We think of this script as a platform to do more with than just static colors.