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 🙂
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.