Giter Club home page Giter Club logo

arduinaap's Introduction

iPodSerial Apple Accessory Protocol (AAP) Arduino library.

This library lets an Arduino interact with an iPod, or some features of the iPod application on the iPhone and iPod Touch*,  via the serial AAP protocol through the iPod's dock connector.

See http://ipodlinux.org/wiki/Apple_Accessory_Protocol for more details of AAP. I used http://nuxx.net/wiki/Apple_Accessory_Protocol during development but it seems to be stale now. The ipodlinux.org one has the correct format of the Advanced Remote polling response, for example, and the nuxx.net version does not.

The library sends commands via serial to the iPod and listens for responses. If and when responses come back over serial from the iPod, the library parses them and passes the data to callback functions provided by the user of the library. Responses are received asynchronously, and so the calling code is not blocked waiting for the iPod to respond; therefore it can continue to blink lights, scroll a display, poll buttons, or whatever.

If you have an Arduino Mega you can take advantage of its multiple serial ports to have debugging messages out one serial port and communication with the iPod on another. The library provides setup functions to let you do this. You could probably also use SoftwareSerial for this.

The library consists of three classes: SimpleRemote, AdvancedRemote and iPodSerial. iPodSerial is a common base class for the other two; it does the low-level protocol stuff to talk to the iPod.

The SimpleRemote class implements AAP Mode 2, aka iPod Remote, aka Simple Remote. This lets you send commands like play/pause, change the volume, etc, but also still control the iPod via its own interace. This is the mode I used for my in-car remote, the write up for which is at http://davidfindlay.org/weblog/files/2009_09_07_ipod_remote.php.

The AdvancedRemote class implements AAP Mode 4, aka Advanced Remote. Be aware that in Advanced Remote mode the iPod will display a large checkmark and the message "OK to disconnect"; in this mode you cannot control the iPod via its own interface so you need to do everything from your Arduino sketch. Advanced Remote has more options though, like being able to put the iPod in polling mode, where it will send you back the currently-playing track's elapsed time every 500ms; you could use this to update a display controlled by your Arduino (I'm thinking nixie tubes with the arduinix shield would be cool!).

NOTE: When connecting your iPod to your Arduino, please double-check your wiring. iPods are expensive and you don't want to break yours by sending it too high a voltage or whatever. You use this library at your own risk etc.

* On my iPhone 3GS and my wife's iPhone 3G I get the "This accessory is not made to work with iPhone" popup and occasionally the longer error message that asks if you want to put it into Airplane mode. Advanced Mode commands don't work. Simple Remote commands do seem to work fine though.

arduinaap's People

Contributors

finsprings avatar ivankravets avatar per1234 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.