Circuit Playground Family Feud Podium
2019-06-06 | By ASHLEY
License: None Circuit Playground
Recently our management approached us to create a podium for the Family Feud fundraiser event being held at EDS, 2019. This project was fun, straightforward, and for a good cause. How could we say no?
Overview:
We designed the game piece to sit on top of a rectangular case with a cutout in the top for all of the electronics to fit nicely into. The game piece itself has a solid top panel with two cutouts for large buttons to be placed in it. The front has two large openings that we placed opaque sheets of acrylic that are held in by screen door tabs. (Similar concept to a picture frame.) The tabs are used so that the panels can easily be removed or replaced. The reverse side of the front piece has a frame with a divider down the center. The divider is there to prevent the light from one side being dispersed to the other side.
To cover the rear side of the frame we have a thin board with neopixel strips placed behind the opaque pieces. They are spaced in a matrix 1”x1” apart roughly and 1.5” back from the acrylic. After some testing, this dispersed the light to give us the look we wanted. No individual neopixels are visible.
The buttons on top have neopixels around the base of them as an indicator for the players so they can see who hit the button first. As soon as the podium is turned on, the front panels will breathe white light waiting for a button press and the buttons will both be illuminated. Once a button is pressed, the opposite player’s lights will all turn off, and the front panel for the winning side will blink that team’s color, then show a solid color for a certain amount of time until it all resets back to the initial state after the time delay. When the buttons are pressed, a left or right keystroke (like from a keyboard) will be sent to the computer the Circuit Playground Express (CPX) is connected to. This will trigger the Feud software to output audio and display to a monitor which side has buzzed in..
Our creative team designed graphics to resemble circuits that we had printed at a local screen print company and placed on the front and top of the podium to give it a finalized and polished look. The biggest challenge? Figuring out how to ship it. Thankfully we have a knowledgeable team in our Product Distribution Center that specializes in shipping out large items.
Programming:
Now to get down to the main detail - programming. The Circuit Playground Express has three language options: block programming, Javascript, or CircuitPython. Because this project is actually very basic when it comes to the components, we decided to keep the programming basic as well and use the block programming on makecode.adafruit.com.
Let’s start with the “on start” code that sets everything to its initial state. The first two blocks set pins A0 and A1 to internal pull-ups that will receive a low signal from the button presses. The next block creates variable “FirstPress” and sets its value to 0. The next two blocks create variables “stripRight” and “stripLeft” to designate separate neopixel strips then define the pins they are connected to and the amount of pixels on each. The next block sets the neopixel brightness to 30. The last two blocks set the color of each strip to white.
The next pieces of the code shown below define what happens with each button press. They each do the same thing aside from the colors. When pins A0 or A1 fall (remember, these pins are set as a pull-up in the “on start” piece) indicating that they were pressed, the first one pressed will check that the variable “FirstPress” is 0, and if it is it change the value of variable “FirstPress” to 1. The “FirstPress” variable prevents the opposing team from buzzing in for a few seconds. Then the neopixels on the CPX will display the appropriate color to indicate to the players which side hit the button first, then the strips on the front will illuminate the winning team’s color on their side and shut the opposing team’s color off (to black) on their respective side. For example, let’s say red wins the button press, the CPX will turn red, the strips illuminating their panel will turn red, and the blue team’s panel will go dark for a moment. This leads me to the next piece of the code.
After the code above with the example I’m using, red’s panel is illuminated red, and blue is black (off). The “forever” loop states that if variable “FirstPress” is 1 (meaning someone pressed a button) then after 200ms the winning team’s panel will flash 5 times by changing the brightness level (the other team’s strip will do nothing because the pixels are set to black, which essentially turns them off). Then both panels brightness levels are set to variable “bright” which alternates between 30 to 255 for a flashing effect.. There is a pause of 5 seconds (this is to give the team time to answer before resetting). “FirstPress” is set back to 0, making the system ready for another button press and “bright” is set back to 30 controlling the brightness level of the neopixels (255 is the highest). The CPX neopixels are turned off, then the variable “updown” is set to 1 and the Neopixels are set to white.
If “FirstPress” does not equal 1 then the forever loop will set both strip brightness levels to variable “bright” to keep breathing white. If “updown” is set to 1, then the variable “bright” will be incremented by 3, if it does not (0) then it will be decreased by 3. If “bright” is less than 30, “updown” will be reset to 1. If “bright” is greater than 245, “updown” is set to 0. This last bit will make the Neopixels brightness climb up and down between 30 and 245, only when they are white, giving them a “breathing” effect.
Please go to this link to download the code: https://makecode.com/_CUvbLc3boYsD
Build:
The podium is comprised of two main pieces, the front that holds the acrylic displays, and the top that holds the buttons. The front dimensions are shown above with cutouts for the white acrylic panels.
The top is shown above with the two larger circles indicating where the buttons were placed and the smaller circle towards the back indicating where the Circuit Playground Express was placed. The pieces were fastened together using hinges so that this could be shipped more easily without any assembly required.
Now, for the rest of the podium the team at EDS build a hollow box essentially for this to set nicely on top of. The box had cutouts on the top for the buttons and other electronics to be able to set down into.
Planning to recreate this or modify it into something else? Make sure you post it on social media and use #MakeWithDigikey and tag us in it!
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum