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!
9 Replies to “1 Pixel video game; component-driven design”
Bout time you changed away from this cumbersome captcha crap
That’s pretty cool. It’s a lot of fun when a project comes together like this. Did you build a case for it? I highly recommend book-shaped boxes 🙂
No case yet. I’d like to program the trippy RGB kit to play the game.
Awesome! Interactive games like this are the best. The simpler they are the more mesmerizing they are! Would be cool if you added some sound too.
Awesome Project, The Large Square RGB led button is a great and it definitely fits the project as it will stand up to abuse. If someone was strapped for cash they could easily use a regular LED that could be surrounded in a ping-pong ball or something similar to further diffuse it and either salvage a larger momentary push button to use for game play, mod a small tactile button or just use it on it’s own. If it were positioned to be hit with the users thumbs, I think it would require a faster response time to challenge many users.
Comments are closed.