Hello community,
I've been trying to set up a system to control Kodak Slide projectors via it's serial port with the arduino. Using the Software Serial protocol and a MAX232 chip, I get already a binary output - but the projector doesn't seem to understand me. I'm using the Kodak P-Com protocol, which needs 3 bytes of information - here's some more information on this: http://slideprojector.kodak.com/plugins/acrobat/ektaproP-com.pdf
I'm guessing the problem is with the configuration of the start and stop-bytes, since I already receive 3 bytes of information when re-checking via serial monitor. The needed setup for the projector is:
1 start bit
8 data bits
no parity
1 stop bit
9600 baud
This is the code I'm using right now:
#include <SoftwareSerial.h>
SoftwareSerial myserial(2, 3); // RX, TX
int zeros=0;
String printStrFirst;
String printStrSecond;
String printStrThird;
int firstbyte=251;
int secondbyte=30;
int thirdbyte=0;
void setup()
{
myserial.begin(9600);
}
void loop()
{
//myserial.print(0xAF, BIN);
//myserial.print(0x11, BIN);
//myserial.println(0x0, BIN);
// first byte
zeros = 8 - String(firstbyte,BIN).length();
for (int i=0; i<zeros; i++) {
printStrFirst = printStrFirst + "0";
}
printStrFirst = printStrFirst + String(firstbyte, BIN);
myserial.print(printStrFirst);
printStrFirst="";
// second byte
zeros = 8 - String(secondbyte,BIN).length();
for (int i=0; i<zeros; i++) {
printStrSecond = printStrSecond + "0";
}
printStrSecond = printStrSecond + String(secondbyte, BIN);
myserial.print(printStrSecond);
printStrSecond="";
// third byte
zeros = 8 - String(thirdbyte,BIN).length();
for (int i=0; i<zeros; i++) {
printStrThird = printStrThird + "0";
}
printStrThird = printStrThird + String(thirdbyte, BIN);
myserial.println(printStrThird);
printStrThird="";
delay(2000);
}