Help with RS232 control of projector

I am trying what I thought would be a simple task but my limited knowledge of arduino is being stretched. I have connected my Uno to the RS232 port of a Kodak Slide projector. I have made the converter circuit using the MAX232 chip and verified that this works.

Basically I need to send three bytes of hex data 05 00 00 which forwards the slide one position. I’ve had this working using a usb to serial adaptor so know the data is correct.

Here is the code

// include the SoftwareSerial library so you can use its functions:
#include <SoftwareSerial.h>

// set up a new serial port
SoftwareSerial mySerial = SoftwareSerial(2, 3);

void setup() {
// define pin modes for tx, rx:
pinMode(2, INPUT);
pinMode(3, OUTPUT);
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
}

void loop()
{
//send hex data 05 00 00 to projector to advance next slide
mySerial.print(0x05, BIN); //byte1 00000101
mySerial.print(0x00, BIN); //byte2 00000000
mySerial.print(0x00, BIN); //byte3 00000000
mySerial.println();
delay(5000); // delay 5 seconds before the next slide:
}

I realise that monitoring the output with the terminal programme that all of the zero’s are being omitted. I’ve tried a few things to solve this with no success. I just need to get the correct data format.

Thanks for looking

refactored the code a bit, 2 points

// !! BIN would cause the output to be 00000101 00000000 00000000
// SWS takes care of the pinmodes.

#include <SoftwareSerial.h>

SoftwareSerial mySerial =  SoftwareSerial(2, 3);  

void setup() 
{
  mySerial.begin(9600);
}

void loop()
{
  //send hex data 05 00 00 to projector to advance next slide
  mySerial.print(5);  // or 0x05
  mySerial.print(0); 
  mySerial.print(0);

  // delay 5 seconds before the next slide:
  delay(5000); 
}

Give it a try