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.
Showing posts with label arduino. Show all posts
Showing posts with label arduino. Show all posts
Friday, February 1, 2013
Wednesday, April 25, 2012
Introducing Proof of Concept Music Glove
Well the day I never thought would come has arrived. I have finished a proof of concept of my android music control using an external (in this case glove) device.
It was a long and slow journey, I've often times got so many projects in the pipeline that it's really exciting when I get to see one finish up.
This evening I finished up wiring my device, and asked @civissmith over to help with the video, so Thanks I really appreciate it, trying to do what I was showing with one hand would have been, painful to say the least.
Basic concept, Buttons attached to arduino send characters to android app, when music is running, pressing a button allows control of the music app.
Without further words, I think the video will be proof enough.
If you'd like to follow me on twitter I can be found here: @onaclov2000
It was a long and slow journey, I've often times got so many projects in the pipeline that it's really exciting when I get to see one finish up.
This evening I finished up wiring my device, and asked @civissmith over to help with the video, so Thanks I really appreciate it, trying to do what I was showing with one hand would have been, painful to say the least.
Basic concept, Buttons attached to arduino send characters to android app, when music is running, pressing a button allows control of the music app.
![]() |
| Shot of Glove |
![]() |
| Shot of Glove |
![]() |
| Button inside glove |
Without further words, I think the video will be proof enough.
If you'd like to follow me on twitter I can be found here: @onaclov2000
Labels:
Android,
arduino,
Bluetooth,
MusicGlove
Monday, October 17, 2011
Music Glove Part 1
Well after much heartburn (and once again being burned by pull down resistors). I have managed to make some progress.
I now have half of my Music Glove prototype complete. This is the hardware side. I paired a bluetooth module from sparkfun (something that does uart). With an arduino to handle the button presses. I can now receive an A and a B from my button presses on my phone using the BlueTerm application.
Once I am able to handle receiving the bluetooth data on the phone side, I will better package the whole assembly.
Here is a shot of the circuit:
Here is the code which does all the work:
/*
What you will need to do is wire up your bluetooth module hooking the RX and TX up to the arduino, then
*/
// A is IO 2
int A = 2; // Switch connected to digital pin 2
int AState = 0; // Switch connected to digital pin 2
int AStatePrev = 0; // Switch connected to digital pin 2
// B is IO 3
int B = 3; // Switch connected to digital pin 3
int BState = 0; // Switch connected to digital pin 3
int BStatePrev = 0; // Switch connected to digital pin 3
int buttonState = 0;
void setup() // run once, when the sketch starts
{
Serial.begin(115200); // set up Serial library at 115200 bps
pinMode(A, INPUT); // sets the digital pin as input to read switch
pinMode(B, INPUT); // sets the digital pin as input to read switch
}
void loop() // run over and over again
{
AStatePrev = digitalRead(A); // Switch connected to digital pin 2
BStatePrev = digitalRead(B); // Switch connected to digital pin 3
delay(60);
BState = digitalRead(B); // Switch connected to digital pin 3
AState = digitalRead(A); // Switch connected to digital pin 2
// Handle button "2" presses
if (BStatePrev==BState)
{
if (BState == HIGH)
{
Serial.println("B");
delay(60);
}
}
// Handle button "1" presses
if (AStatePrev==AState)
{
if (AState == HIGH)
{
Serial.println("A");
delay(60);
}
}
}
I now have half of my Music Glove prototype complete. This is the hardware side. I paired a bluetooth module from sparkfun (something that does uart). With an arduino to handle the button presses. I can now receive an A and a B from my button presses on my phone using the BlueTerm application.
Once I am able to handle receiving the bluetooth data on the phone side, I will better package the whole assembly.
Here is a shot of the circuit:
Here is the code which does all the work:
/*
What you will need to do is wire up your bluetooth module hooking the RX and TX up to the arduino, then
*/
// A is IO 2
int A = 2; // Switch connected to digital pin 2
int AState = 0; // Switch connected to digital pin 2
int AStatePrev = 0; // Switch connected to digital pin 2
// B is IO 3
int B = 3; // Switch connected to digital pin 3
int BState = 0; // Switch connected to digital pin 3
int BStatePrev = 0; // Switch connected to digital pin 3
int buttonState = 0;
void setup() // run once, when the sketch starts
{
Serial.begin(115200); // set up Serial library at 115200 bps
pinMode(A, INPUT); // sets the digital pin as input to read switch
pinMode(B, INPUT); // sets the digital pin as input to read switch
}
void loop() // run over and over again
{
AStatePrev = digitalRead(A); // Switch connected to digital pin 2
BStatePrev = digitalRead(B); // Switch connected to digital pin 3
delay(60);
BState = digitalRead(B); // Switch connected to digital pin 3
AState = digitalRead(A); // Switch connected to digital pin 2
// Handle button "2" presses
if (BStatePrev==BState)
{
if (BState == HIGH)
{
Serial.println("B");
delay(60);
}
}
// Handle button "1" presses
if (AStatePrev==AState)
{
if (AState == HIGH)
{
Serial.println("A");
delay(60);
}
}
}
Labels:
arduino,
Bluetooth,
MusicGlove
Subscribe to:
Posts (Atom)



