SoftwareSerial and the Ipod

I have successfully sent commands to the Ipod through the Tx/Rx pins on the Arduino but have not been able to receive anything. The reason I'm told is that you can't have 2 devices on Tx/Rx at same time.

Now I'm trying to connect to the Arduino with SoftwareSerial but I'm not even able to send commands to the Ipod.
What seems to be wrong with my code for SoftwareSerial?

Thanks in advance!

(Ipod 5th Gen running version 1.3 / Mac / Zterm for Mac @9200 baud)


#include <SoftwareSerial.h>

#define txPin 2
#define rxPin 3

SoftwareSerial podIn = SoftwareSerial(rxPin, txPin);

int buttonRelease[] = {
0xFF, 0x55, 0x03, 0x02, 0x00, 0x00, 0xFB };
int playPause[] = {
0xFF, 0x55, 0x03, 0x02, 0x00, 0x01};

void setup() {
Serial.begin(9200);
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
}

void loop() {
sendCommand(playPause);
delay(2000);

}

int chkSum(int a[]) {
int t = 0;
for (int i=2; i<a[2]+3; i++) {
t = t+a*;*

  • }*
  • int sum = 0x100 - (t) & 0xFF;*
  • return sum;*
    }
    void sendCommand(int cmd[]) {
  • int cs = chkSum(cmd);*
  • podIn.println(cs, HEX);*
  • cmd[cmd[2]+3] = cs;*
  • for (int i = 0; i < cmd[2]+4; i++) {*
    _ podIn.print(cmd*, BYTE);_
    _
    }_
    _
    for (int i = 0; i < 8; i++) {_
    _ podIn.print(buttonRelease,BYTE);
    }
    }*_