Overview:

We were inspired by our initial idea of music and guitar playing which then led to us building a project centered around mimicking rhythm and pattern. We decided claps would be a great way to send patterns back and forth to each other and make it into a game.

Instructions:

The game components are the LEDs and buttons. When a person starts the game, they will send over a number of claps with a specific rhythm. Over the MQTT, the other player will have their lights flash the same amount of times so they can see the pattern. The object of the game is for the other user to mimic the same pattern, and once the person who started the game has confirmed they have, then the game is done.

Video showing the sound detector working

Video of Light Response to Sound

Issues/Adjustments:

Some of the issues we dealt with resulted from an early attempt to have the bluefruit detect if the pattern of claps was correct. To achieve this, we attempted to create a series of arrays and variables that would measure and store the time in between claps and then cross-reference it with the response. However, some errors came up with this approach, so we decided to use to press one of the inbuilt buttons as a way of indicating if the pattern was correct.

Another aspect of the code that could be further fine-tuned is the sound threshold. We wanted to set the threshold to a value where it could detect the claps, but filter out unwanted noise. Our current threshold is pretty good at filtering out sounds softer than a clap; however, it is still sensitive to most speech. Additionally, when one puts their finger close to the bluefruit it sometimes detects a multitude of claps and starts blinking rapidly.