SparkTwister is a physical game for 4 or more players. Each player wears a simple controller bracelet made of a Spark.io board with a SparkButton shield and an RGB sensor. When the game starts, all LEDs on your bracelet light up in the same color. Now you have to find another player with the same color and hold your bracelet against theirs. When you do, the RGB sensor on your bracelet will detect this, and the two of you each score one point. One LED on your bracelets will turn off to indicate this, and the rest will change to a new random color, for which you now have to find a new matching player. So you're always running around, trying to find (and convince) others to pair their color-matching bracelets with yours instead of those of other players. Whoever manages to first turn off all LEDs on their bracelet, wins the game. But of course, who would pair their bracelet with a guy who is only one LED away from winning the game?...
Each bracelet also sends its current player ID, score and color wirelessly to the iWall, an open-source interactive facade display with 20,000 RGB LEDs we developed recently. The iWall displays a current bar chart of all players competing, on the side of our Computer Science building.
SparkTwister was created entirely during our November 2014 Build Night. Thanks to Spark.io and Instructables for your support!
Authors: Dominik Schlutter (Core code), Gustavo Brant de Carvalho Marques (bracelet), David Peters (RGB sensor code), Jan Thar (RGB sensor board), and Prof. Jan Borchers (project lead), all from Dorkbot Aachen at RWTH Aachen University in Germany. Thanks to all other Dorkbotters for their support, especially Wolfgang for his twist on our game idea!
For 8 players, you need:
Step 1: Make the Sensor PCB
We provide the Eagle source files for the schematic and the board above. The files also include PDF renderings of the board and schematic for quick reference.
Solder the RGB sensor, resistors, and pin headers to the board as indicated.
Step 2: Making the bracelet
Step 3: Upload the SparkTwister code to your Spark Cores
The game code is rather simple: It turns on all LEDs with a random color, then waits for the RGB sensor to report a matching color, then turns off one LED and turns the rest on in a new random color. This continues until the last LED is turned off, at which point you've won the game and get a rainbow effect.
In practice, things are a little more tricky. For one, the LEDs should really be turned off while we query the RGB sensor (we don't do this yet), because right now we get bias through the color of the LEDs around it reflected back from the surface of the other board. Also, the RGB sensor is rather noisy, and it's a lot of tweaking thresholds to get good color classifications. This should really be done using a proper Support Vector Machine (SVM) algorithm. For now, we get decent classifications with a few simple linear comparisons. We also tried a running average to decide if we are looking at a matching color, but with mixed results. Finally, the sensor also may drift with temperature, so sitting right next to the toasty Spark Core MCU could be a problem.