Showing posts with label MusicGlove. Show all posts
Showing posts with label MusicGlove. Show all posts

Monday, September 23, 2013

Cc2541 ti bluetooth mcu

This may work for a replacement to my arduino/Bluetooth combo for music glove, need to install eagle to view for size http://t.co/nzGrj1LBKa

And may need to adjust circuit, ideally I would like coin battery usage

Pressure Sensor

Don't have time to watch this right now but may be a solution for my fingertip buttons http://m.instructables.com/id/eTextiles-How-to-Make-a-Pressure-Sensor/

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.

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.

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

Monday, April 16, 2012

Causing the next song to play

With the android music player you can change songs using the following broadcast. It's not guaranteed to work with any other music players, or even with any updates they make, however it works for what I need right now (I have no interest in making a music player), If you have a music app and have an intent to change songs,etc, please let me know and I'd be happy to support if possible. I found this across the interwebs somewhere probably nearly a year ago now, I can't remember where I found it, or who wrote it, so if you are the one responsible I would love to give you credit (i'm sure it came from stackoverflow at one point, but after a lot of searching recently I can't seem to find anything about it).
Intent i = new Intent("com.android.music.musicservicecommand"); i.putExtra("command", "next"); sendBroadcast(i);
Good luck.

Modifying Bluetooth Chat

I started out trying to pull the android bluetooth chat application from the developer website....BAD IDEA. I spent quite a bit of time commenting this out, adding a toast here and a if then there. That one is built for a different sdk version than I'm using, so my recommendation would be to pull it from the examples folder in the sdk download.

Well I finally grabbed the bluetooth chat application from the sdk examples folder (when you download from google). After about 5 minutes I tried loading the default app on my phone and touchpad, it worked just fine. I then changed ONE LINE of code and my arduino can talk to my android devices with bluetooth. What line say you? This one:

In the BluetoothChatService.java
From
private static final UUID MY_UUID = UUID.fromString("fa87c0d0-afac-11de-8a39-0800200c9a66");

To
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");


That's it that's all it took. Apparently that UUID from what I've been able to gather is for the bluetooth serial interface, so that's all I needed.

Here is video proof of the application in action.





http://youtu.be/Zof0IYUU71Q

Good luck and let me know if you have any questions.

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);
    }
  }

}