ipod interface

Goal of this project is to control an iPod in an alternative way. The new controls comprise 4 buttons (Menu, play/pause, in, out), a rotary encoder with push switch (select), a 2 line LCD and a motorized fader.

The following I/O is used: The LCD, buttons, rotary encoder and a buzzer are connected to I2C via an MCP23017. PortA connects to the LCD data (8bit) and the switches, PortB connects to the LCD control, the buzzer, the rotary encoder and the common line (via diodes) of the switches. In order to quickly detect a change in the rotary encoder or the buttons, the mirrored INT output is connected to an InterruptIn. The iPod is connected via a dock to a Serial (3.3V). The fader is connected to 3 PwmOut outputs via an L293 as in the standard motordriver, the wiper is connected to an AnalogIn. Optionally a touchsense circuit can be connected to a normal DigitalIn.

The iPod software is contained in two classes: The class 'ipod' which builds, sends, receives and parses the Advanced iPod Remote commands; and a class 'ipodcontrol' that keep tracks of the state of the iPod and is responsible for navigation, playback, reporting of song, artist, elapsed time etc.

The user interface comprises three classes: class MCP23017, an adaptation of an existing class; class LCDText23017, an adaptation of another I2C LCDText class; class keyboard, responsible for reading the keys and the rotary encoder.

The fader comprises two classes: class 'servo' which moves the wiper to a certain setpoint; class 'fader' extends 'servo' with input functionality (i.e. move the wiper manually and use the new position as setpoint.

It's the task of the main program to integrate these three libraries into a useful application.

I had some problems with noise on the analog input so I built a median filter to get rid of the spikes. I published the filter library, feel free to test it.


Please log in to post comments.