Android (Processing App) talking to Arduino via bluetooth
I recently bought a Samsung Galaxy S3 Mini phone. I have been exploring ways of creating apps to communicate with an Arduino board via bluetooth.
Having tried MANY different example sketches, I found some very useful code from:
www.prof-takaya.blogspot.co.uk/2013/02/connecting-android-and-arduino-by.html
I created my own arduino sketch and put parts of the processing sketch into functions which I could call in my main program. I created them in such a way that in future, I can simply add a new tab in Processing and paste all of the bluetooth code there, so I can create a program as normal, calling bluetooth functions when I need them. This made the code very tidy and easy to understand.
My first app involves the Android sending signals to the Arduino to control 3 LEDs. The user simply has to touch the circles on screen to turn the actual LEDs on or off. See the video below to get a better idea as to how it works:
Having tried MANY different example sketches, I found some very useful code from:
www.prof-takaya.blogspot.co.uk/2013/02/connecting-android-and-arduino-by.html
I created my own arduino sketch and put parts of the processing sketch into functions which I could call in my main program. I created them in such a way that in future, I can simply add a new tab in Processing and paste all of the bluetooth code there, so I can create a program as normal, calling bluetooth functions when I need them. This made the code very tidy and easy to understand.
My first app involves the Android sending signals to the Arduino to control 3 LEDs. The user simply has to touch the circles on screen to turn the actual LEDs on or off. See the video below to get a better idea as to how it works: