It didn’t take me and Robert long to find an RGB LED pushbutton. I composed a short part number using the NKK data sheet and found a KP0215ASBKG03RGB-2SJB. I made a simple perf board shield with the proper resistors for my Arduino Mega 1280 and re-learned Arduino to light it up.
Gaussian curves from https://www.desmos.com/calculator/zkmpvehya3When I wanted to smoothly fade between all the available RGB colors, I couldn’t find a good solution. So I made my own using Gaussian curves. Here is a picture and link to the online graphic calculator desmos that was very helpful visualizing the LED levels.
There is more:
I also used the online Arduino IDE Codebender.cc to program the Arduino from a few different computers. It all runs off a chrome or firefox extension. I have embedded the code below. You can upload it to you Arduino right from this window.
I eventually got the RGB LED fading really well as you can see in this Vine:
After this success, I came up for the idea of the game with Brendan. I then coded a simple color matching game. In void setup() it flashes some colors, displays some ASCII art over serial and picks and displays a color. If you don’t touch it, the program goes into Demo Mode and just rotates pretty colors. If you press the button, the colors slowly cycle. You let go when you think it matches the color you remember, and then judges your guess. The video below shows the whole process and some design:
This project was very interesting to do. Every decision was made as needed. I went from finding the component, getting it, building something, making it to display some fun, imagining a game around that fun, coding it, to enjoying the game in about a week of fixation. I wish you could all play with this simple device, but only the few that come to Hive76 open house on any Wednesday night will play it. Come play the 1 pixel video game!