luciusf:
As been said, we are able to send the commands via a terminal directly to the projector without any problems. I use termite with the hexview plugin for that. It's easy, just type in 0xFD0000 (for example).
And i'm just trying to mimic that. Still don't see the problem with the following for example. If i connect the output of the arduino with an windows com-port i can see the result, and i seems to be correct.
Seems to me that the next step would be to connect a logic analyser or 'scope and compare the physical signals over the RS232 link in the working (PC software) and non-working (Arduino) cases. From what you've said, you've checked every potential reason for the senders to behave differently but evidently there is some difference. Perhaps when you see the output you'll have that face/palm moment when you realise you neglected to connect the DTR line, forgot to use a crossover cable or got the polarity backwards.
I used the information in this thread to write a small sketch that controls an Kodak Ektapro 7000 projector with a Philips dvd remote or an Apple remote.
Functionality:
Start/stop slideshow (a new slide every 5 seconds) (play/stop key on Apple remote, play and stop key on Philips remote)
Slide forward/backward ( < and > keys on Philips remote, |<< and >>| keys on Apple remote)
Focusing (not tested with lens yet, could be to much of a delay) ( arrow up and arrow down on philips remote, + and - on Apple remote. )
Standby on/off (Power key on Philips remote)
Debugmode on/off (command description to serial) (mute on philips remote)
I post the sketch here for other persons that might be interested in controlling an Ektapro projetor.
Requirements:
Connect TSOP to pin 11 for IR reception
Tx is used to communicate with the projector (no software serial needed).
Max232 chip must be placed between Tx and the projector.
Uses Philips (RC6) dvd remote or Apple (Nec) remote. Apple remote has a limited command set.
Set projector address to 1 (on the back of the machine)
/**
Controleer ektapro diaprojector
*/
#include <IRremote.h>
int RECV_PIN = 11; // ir receive op pin 11
boolean slideShowRunning = false; // in slideshow mode or not
long SlideshowPreviousMillis = 0; // remember when the last slide was showed
long SlideshowInterval = 5000; // interval between slides in milliseconds
boolean focussing = false; // in focussing mode or not
long FocussingPreviousMillis = 0; // remember when key was pressed for key press check
long FocussingInterval = 300; // interval for key press check in milliseconds
boolean standBymode = true;
boolean debug = false;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
// start serial port at 9600 bps:
Serial.begin(9600);
irrecv.enableIRIn(); // Start the IRreceiver
}
void slideForward() {
if (debug) {Serial.println("forw"); }
Serial.write((byte)0x0D);
Serial.write((byte)0x00);
Serial.write((byte)0x00);
delay(300); // delay to stop double keypresses on philips
}
void slideBackward() {
if (debug) { Serial.println("backw"); }
Serial.write((byte)0x0D);
Serial.write((byte)0x04);
Serial.write((byte)0x00);
delay(300);
}
void focusForward() {
if (debug) { Serial.println("focusForward"); }
Serial.write((byte)0x0D);
Serial.write((byte)0x08);
Serial.write((byte)0x00);
focussing=true;
FocussingPreviousMillis=millis();
}
void focusBackward() {
if (debug) {Serial.println("focusForward"); }
Serial.write((byte)0x0D);
Serial.write((byte)0x0C);
Serial.write((byte)0x00);
focussing=true;
FocussingPreviousMillis=millis();
}
void focusStop() {
if (debug) { Serial.println("focusStop"); }
Serial.write((byte)0x0D);
Serial.write((byte)0x10);
Serial.write((byte)0x00);
focussing=false;
}
void StandbyModeOn() {
if (debug) { Serial.println("standbymodeon"); }
Serial.write((byte)0x0B);
Serial.write((byte)0x1E);
Serial.write((byte)0x00);
delay(300);
}
void StandbyModeOff() {
if (debug) { Serial.println("standbymodeoff"); }
Serial.write((byte)0x0B);
Serial.write((byte)0x1C);
Serial.write((byte)0x00);
delay(300);
}
void loop () {
// een dia vooruit
if (irrecv.decode(&results)) {
if (debug) { Serial.println(results.value, HEX); }
// NEC
if (results.value == 0x77E1E00F || results.value==0x45B || results.value==0x1045B) {
slideForward();
} else if (results.value == 0x77E1100F || results.value==0x45A || results.value==0x1045A) {
slideBackward();
} else if (results.value == 0x77E1200F ) {
Serial.println("stop/start");
if (slideShowRunning) {
slideShowRunning=false;
SlideshowPreviousMillis=0;
} else {
slideShowRunning=true;
}
// philips start slideshow
} else if (results.value==0x42C || results.value==0x1042C) {
slideShowRunning=true;
// philips stop slideshow
} else if (results.value==0x431 || results.value==0x10431) {
slideShowRunning=false;
SlideshowPreviousMillis=0;
// philips stanby on/off
} else if (results.value==0x40C || results.value==0x1040C) {
//Serial.println("standbyon/off");
if (standBymode) {
StandbyModeOff();
standBymode=false;
} else {
StandbyModeOn();
standBymode=true;
}
} else if (results.value==0x40D || results.value==0x1040D) {
//Serial.println("standbyon/off");
if (debug) {
Serial.println("... exiting debug mode");
debug=false;
delay(300);
} else {
debug=true;
Serial.println("entering debug mode...");
delay(300);
}
// start forward focussing
} else if (!focussing && (results.value == 0x77E1D00F || results.value==0x458 || results.value==0x10458) ) {
focusForward();
// start backward focussing
} else if (!focussing && (results.value == 0x77E1B00F || results.value==0x459 || results.value==0x10459) ) {
focusBackward();
}
// keep focussing while key is pressed
if (focussing) {
FocussingPreviousMillis = millis();
}
irrecv.resume();
} else {
// stop focussing when no key is pressed for x milliseconds
//Serial.println("nosignal");
unsigned long currentMillis = millis();
if (focussing) {
if(currentMillis - FocussingPreviousMillis > FocussingInterval) {
focusStop();
}
}
if (slideShowRunning) {
if(currentMillis - SlideshowPreviousMillis > SlideshowInterval) {
slideForward();
SlideshowPreviousMillis = currentMillis;
}
}
}
//Serial.println("loop");
// effe wachten...
//delay(2000);
delay(100);
}