Having the small version CyCubeTouch done, it's now time to think bigger. Do you remeber the classic game "Simon Says" - why not using your feet? It makes thinking sportive!
Having 9 colored fields instead of the originally 4 colored pads - the user must repeat the microcontroller generated sequence. Each round will be extended by one further step.
How good is your memorization? How sportive you are to walk the steps. And keep the time in mind.
ElectronicsThe electronics is relatively easy - using a Infineon microcontroller supporting CAPSENSE™, like PSOC63™. For future purpose the integrated Bluetooth LE would be available for wireless communication, e.g. the game level, points or time. Well, for the moment let's focus on the essential, touch detection, when the player stand on a field.
9 fields have been build up mechanically, see below, and each pad has a CAPSENSE electrode (pure 5 by 5 cm copper foil) connected to 9 pins of the microcontroller.
One strip of NeoPixel (WS2812B) with 9x 72, in total 648 LEDs, are addressed via the serial data stream generate by help of the microcontroller's SPI interface.
For the pure game this would ne enough electronics, however a simple 8x32 matrix display based on MAX7219 is connected via SPI and using a Level-Shifter to allow a longer cable distance for placing the display somewhere aside.
MechanicsThe following picture shows the mechanical setup:
The software is basically based on a state-machine architecture
void CubeFSM(void)
SM_INITIALIZE: initialization and generation of a random sequence
SM_PLAY_COMPUTER: light up (in blue color) the sequence, starting with one and increasing by 1 every new round
SM_PLAY_USER: Detects the user touches when walking along the sequence and evaluates whether it was correct or not. (-> SM_SUCCESS or -> SM_FAIL)
SM_SUCCESS: Lights all fields green to indicate the all fields are passed correctly, what means one new field is added to the sequence (-> SM_PLAY_COMPUTER)
SM_FAIL: Shows number of steps, high-score, and user-play-time on the external display... (-> SM_INITIALIZE)
The player needs to repeat the previous - by microcontroller randomly generated - shown sequence (blue marked fields). The sequence is generated randomly by the microcontroller.
When stepped to a wrong field all field are shown red, beside of the correct field in blue.
The player has to leave all fields after the complete sequence was done correctly or in case, a wrong field was already touched before.
The external display shows alternately the current level (steps) of the computer and player, as well the pure user playing time, as well as the actual high-score
SummaryThis project shows how easily Infineon's CAPSENSE™ can be used, for any kind of capacitive sensing. No 'real touch' is needed. The sensitivity is really great, either with the older generation. With the latest 6th generation, on some devices like PSOC™ 4100T Plus, beside of capacitive up to 16 channel inductive inputs are available for detecting metal, that needs to be tested by another projects.
Well - that's it!... for the moment. Stay tuned!
Regards, Holger








Comments