views:

149

answers:

3

hi i need to create a simple connector. I think i may need to create an arduino board that will take data from the application and then transmit them to an external device.

There is a slider in the application which the user can adjust. When adjusting the slider the application will just send in values from the application to the connection that i need to make which will connect to the external device.

Step 1: How do i program the ipad application so that it will transmit to the connecter? there must be some api to achieve this.

Step 2: What do i need to use to create the connecter (a circuit board which will read the simple string data coming in and then transmit say an integer back out to the external device) so that my iphone can communicate with it?

I really need help with this one. Ive never done this before but i need to get this done.

+3  A: 

In order get get access to the APIs necessary to develop apps that use the dock connector to talk to external hardware, you have become a member of Apple's Made for iPhone program. It's not a particularly simple process.

You're better of designing a device that can use WiFi to talk to the iPhone, then you can use the standard networking APIs and don't need any special permission from Apple.

Andrew Madsen
+2  A: 

You can communicate with MFi-sanctioned devices using the External Accessory framework included in iOS. It is laughably simple (standard stream processing) to interface with these devices.

The trouble is building an MFi-sanctioned device. For both regulatory reasons (inescapable) and Apple's own policies (QA, don't want to associate with shonky hardware) the MFi Program isn't nearly as easy to get into as the iOS Developer Program. What's more, people/businesses operating in the program are under NDAs.

Building iPhone OS Accessories by Ken Maskrey is a good read and probably the most detailed account of the MFi program you'll get outside of the NDA. It answers most of the questions you've posed.


That said, there's an alternative. If you don't mind jailbreaking your iOS device, a few of the pins in the 30-pin connector (available from Sparkfun, including a break-out board) are standard RS-232. The other pins are documented too, if that's of interest.

The serial port is available at /dev/tty.iap, a character device. There are also a few tutorials available. That all said and done, it's considerably simpler (and App Store-safe) to use 802.11 -- hopefully your device doesn't mind the extra power draw!

Sedate Alien
+4  A: 

The other answers are good, but there is one final alternative - you can use phase-shift keying (or similar methods) to connect a device to the iPhone via the headphone/microphone socket and communicate with the device via audio tones.

Someone has done a library for this already, however I can't currently seem to find the link. They did claim they'd got apps into the appstore that use this method.

Update

Found a good collection of links about this here:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274970878

JosephH
I've been considering doing exactly this, here's the two links I've got bookmarked - http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274970878 and http://www.perceptdev.com/labs/content/iphone-keyboard-no-jailbreaking-required-using-20-sdk (actually, I blogged about it here: http://bigiain.posterous.com/iphone-app-idea )
bigiain
That's an excellent point, I can't believe that it slipped my mind! An example of such a device: https://squareup.com/
Sedate Alien