Friday, February 1, 2013

Music Glove Explained

I realize (thanks to a twitter follower) that I never really explained how my music glove actually works.
(Introducing Proof of Concept Music Glove)

Here goes.

The glove connects to the arduino over I/O. (basically just use some I/O pins to read a pressed state).

I wrote some code (referenced by this post: ) to transmit over the arduino's RS232 (Serial) port. The RN-42 uses RS232 to communicate to the device, so as long as the baud rate, etc are the same, then sending data from the Arduino to the RN-42 is a breeze.

Next we need a way to read the data. Download the bluetooth chat application from google (located here: ), modify it where the line says

Next I added some code to read received data.

The receive message section should look something like this:


Changing Volume, songs, etc, are all located in the following function I stuffed in there.

Of course you need a preferences to deal with things but you don't have to, you can simply just say if you see A, then do the action listed for the one you want in the above code.
Put it all together and you have a device which will change the volume or songs (if you set it up via preferences). Remember that some of the options are not publicly declared intents so they work right now, but may change in the future. If you have further questions go ahead and leave a comment, or find me on twitter @onaclov2000.