I have a 2nd generation iPod nano that I'm trying to control with my arduino.
I'm using the Apple_Accessory_Protocol found on ipodlinux.org:
I can get all the mode 2 commands working, but when i try to send mode 4 commands (after switching to mode 4) I get either no response at all (on some commands) or i get an error response (0x04 0x00 0x01 0x04). which means: 4=you exceeded the limit of whatever you were requesting/wrong parameter-count.
example, if i send: 0xFF, 0x55, 0x03, 0x04, 0x00, 0x1E, 0xDB i get the response: 0xFF, 0x55, 0x06, 0x04, 0x00, 0x01, 0x04, 0x00, 0x1E, 0xD3.
but I have tried this for quite a few commands, either the information on what parameters to send is wrong, or mode4 commands doesn't work on a 2g nano, or somehow I'm sending it wrong.
Does anyone here have any clues to what's wrong?
here is how i connected it and some code.
(signal goes from tx on arduino through 1kohm resistor to rx on ipod and through 2kohm more to ground, pin21 connected to ground with a 500ohm resistor (have tried some different resistors, including 500kohm))
Rx (input 0) --------------------iPod pin12 Tx
Tx (output 1) ---[1k]-------------iPod pin13 Rx
|
| ----iPod pin21 Accessory
| |
| |
2k 500
| |
| |
Gnd-------------------------------iPod pin11 Ground
code in arduino:
byte switchMode4[] = {0xFF, 0x55, 0x03, 0x00, 0x01, 0x04, 0xF8};
byte getPosition4[] = {0xFF, 0x55, 0x03, 0x04, 0x00, 0x1E, 0xDB};
void setup ()
{
Serial.begin(19200);
for (int i=0;i<8;i++){
Serial.print(switchMode4*,BYTE);*
}
}
void loop ()
{
/*for (int i=0;i<7;i++){ // i have experimented with different lengths.
Serial.print(getPosition4*,BYTE);*
}
delay(2000);
}