p5 serial RGBW candle

This week we worked with DOM libraries in p5. I decided to use four DOM sliders to control a 40Watt RGBW LED by outputting serial from p5 into an arduino.

The code to do this took a lot of trial and error on the serial side. The outputs from the four sliders are made into a serial string, then parsed in the arduino code to four analog outputs.

Here is the p5 code:

and the Arduino code:

The sketch is very simple looking 🙂

Screen Shot 2015-10-16 at 11.05.21 AM

I mounted the RGBW LED to an old pentium II heatsink, and connected the four anodes to the arduino’s analog outputs through four TIP120 transistors.





Leave a Reply

Your email address will not be published. Required fields are marked *