Friday 7 October 2011

iPhone to PC to Hand!

This should be my final Robot Hand instalment folks!

I'm not gonna post the Arduino code because I simply used the "servo firmata" program which is in the examples section of the Arduino software. With the "servo firmata" program loaded onto my Arduino, all I needed to do was figure out some software called "Processing". Processing allows you to do all sorts of things from you pc and other devices. In my case it will allow me to talk to the Arduino from my PC as long as the USB cable is connected between the Arduino and the PC. Best of all, the programming language is pretty much the same as the Arduino!
So anyway, to get the Processing code to work, I first had to add the arduino.cc library and the oscp5 library. The oscp5 library automatically added the netp5 library. Both of these libraries can be found at the following:
With these libraries loaded up, the code I pieced together mainly from the two sources in my last post actually worked!

So before I could actually try this out, I needed to sort the iPhone side of things out. I used software called TouchOSCEditor to create a layout which I then uploaded to my iPhone.
So what happens now is my iPhone sends a signal from which ever button is used in the app. This signal is listened for by processing. Processing then takes that signal and sends an instruction through the USB cable, all the way to the Arduino. And ta-da! A moving robot hand!

Here's the TouchOSC layout I made:
I labelled each of the faders; /1/fader1, /1/fader2, etc, from left to right.




Here's a couple of links for the processing code and the TouchOSC layout. (Remember you only need to use the "servo firmata" program for the Arduino)


robot_hand_serial_processing_code_firmata.pde
robot_hand_fader.touchosc


Thursday 6 October 2011

Now Controlled by my iPhone!

I just finished adding a new control method to my Robot Hand; my iPhone!

This was achieved by keeping it connected to the pc and running some software called "processing". That software then talks to my iPhone over wifi when I use an app called "TouchOSC". Unfortunately it will cost you about $6 on the app store. I'm pretty sure there is an equivalent app for android and it's probably a lot cheaper too!

I used the following tutorial as a starting point and used some code from another project I found on youtube.
http://www.sparkfun.com/tutorials/152 (How to control an Arduino with your iPhone)
http://www.youtube.com/watch?v=s9etKD2y-Zk (Arduino iPhone colour mixing tutorial)

From these two sources mainly, I eventually figured it out!


Check it out the final product: