Did you know that you’re able to use a color gradient to control the LEDs? It might sound a little bit crazy, but this high definition Arduino LED Color Picker is surely becoming the best tool for you!
For your information, the Arduino LED Color Picker is written in Java and uses the same library (RXTX) as Arduino. In this case, it will run on any platform, which is supporting Windows, Mac or Linux! The library is extremely easy to integrate and allows the users (like us) to receive color events in real-time.
Below here is the basic process flow of the Java application:
First of all, open serial port to Arduino.
Secondly, initialize color picker component and register an event handler.
Thirdly, wait for color picker event (It might take up to few seconds).
Then, send color to Arduino.
Lastly, wait for reply from Arduino (ACK).
The Arduino LED Color Picker runs in different thread and sends color events to the main thread. Basically, the Java application is used to sends the RGB colors in a sequence of four bytes: Red, green, blue and a EOT byte. The EOT byte signals the end of a color sequence and instructs the Arduino to process the color immediately!
Soon after the Arduino had processed the color, it instantly sends an ACK byte back to the Java application. So, without the ACK byte, you’ll have the chance of overflowing the buffer by sending color events faster than the Arduino can process them, and that’s why we should avoid this situation!