Make has put together an enticing kit for those interested in doing a little Arduino programming alongside the iPhone. The Redpark Breakout Pack is basically a serial cable with a connector on it that will go from an iPhone to an Arduino and let you send signals back and forth, even without jailbreaking.
There's a guide for setting up a simple project, but you'll have to have some previous knowledge of how to connect and run an Arduino, as well as create and run code on