added extra send_previous() to all code except the Toshiba_SD590, because it needs the pause and single send_previous() to sync correctly.

This commit is contained in:
foley@ru.is
2013-09-13 19:37:53 +00:00
parent 276228d653
commit 16899eda2d
3 changed files with 23 additions and 20 deletions

View File

@@ -27,7 +27,7 @@ int pinLED=13; // The heartbeat LED on the board
int heartbeat=0; int heartbeat=0;
int secs; int secs;
// Sarcity 20:58 // Sarcity 20:58
int playtime= 20*60+57; // Play time in seconds, you usually leave off a second or two int playtime= 22*60+10; // Play time in seconds, you usually leave off a second or two
//int playtime= 10; // testing //int playtime= 10; // testing
@@ -39,8 +39,7 @@ void setup() {
Serial.begin(115200); Serial.begin(115200);
Serial.println("Panasonic DVD DVP-3142/12 Synchronizer $Rev$"); Serial.println("Panasonic DVD DVP-3142/12 Synchronizer $Rev$");
Serial.println("For \"Sarcity\" by Thor Elis (1981) Serial.println("For \"Sarcity\" by Thor Elis (1981)");
");
Serial.println("Code by Joe Foley <foley@ru.is>"); Serial.println("Code by Joe Foley <foley@ru.is>");
Serial.println("$URL$"); Serial.println("$URL$");
Serial.println("$Id$"); Serial.println("$Id$");
@@ -55,15 +54,18 @@ void setup() {
Serial.println(""); Serial.println("");
secs=playtime; secs=playtime;
send_play();
} }
/********************************************************************/ /********************************************************************/
void loop() { void loop() {
Serial.println("Sync"); Serial.println("Sync");
send_pause(); //send_pause();
waitsec(2); //waitsec(2);
// The three players don't always see the "previous command" so we send it multiple times
send_previous();
send_previous();
send_previous(); send_previous();
//waitsec(2); //waitsec(2);
// Don't send play because previous automatically starts it // Don't send play because previous automatically starts it
@@ -108,7 +110,7 @@ void waitsec(int sec) {
void send_stop() { void send_stop() {
// First comes the pre-data bits, then the command code // First comes the pre-data bits, then the command code
Serial.println(" stop"); Serial.println(" stop");
irsend.sendNEC(0x10431,20); irsend.sendRC6(0x10431,20);
} }
/********************************************************************/ /********************************************************************/

View File

@@ -56,14 +56,16 @@ void setup() {
/********************************************************************/ /********************************************************************/
void loop() { void loop() {
Serial.println("Sync"); Serial.println("Sync");
send_pause(); //send_pause();
waitsec(2); //waitsec(2);
send_previous();
send_previous();
send_previous(); send_previous();
//waitsec(2); //waitsec(2);
// Don't send play because previous automatically starts it // Don't send play because previous automatically starts it
// If we hit play it will merely pause it. // If we hit play it will merely pause it.
send_play(); //send_play();
for(int t = 0; t < playtime; t++) { for(int t = 0; t < playtime; t++) {
// This will not give us perfect 1 second timing // This will not give us perfect 1 second timing
@@ -110,19 +112,19 @@ void send_stop() {
void send_play() { void send_play() {
// First comes the pre-data bits, then the command code // First comes the pre-data bits, then the command code
Serial.println(" play"); Serial.println(" play");
irsend.sendRC6(0xFFF00F,32); irsend.sendNEC(0xFFF00F,32);
} }
/********************************************************************/ /********************************************************************/
void send_pause() { void send_pause() {
// First comes the pre-data bits, then the command code // First comes the pre-data bits, then the command code
Serial.println(" pause"); Serial.println(" pause");
irsend.sendRC6(0xFFD02F,32); irsend.sendNEC(0xFFD02F,32);
} }
/********************************************************************/ /********************************************************************/
void send_previous() { void send_previous() {
// First comes the pre-data bits, then the command code // First comes the pre-data bits, then the command code
Serial.println(" previous"); Serial.println(" previous");
irsend.sendRC6(0xFF50AF, 32); irsend.sendNEC(0xFF50AF, 32);
} }

View File

@@ -46,9 +46,9 @@ void setup() {
Serial.print(secs % 60); Serial.print(secs % 60);
Serial.println(""); Serial.println("");
// The DVD player starts playing automatically, so we should pause it // The DVD player starts playing automatically, so maybe we should pause it
send_pause(); //send_pause();
waitsec(2); //waitsec(2);
secs=playtime; secs=playtime;
} }
@@ -58,11 +58,10 @@ void loop() {
Serial.println("Sync"); Serial.println("Sync");
send_pause(); send_pause();
waitsec(2); waitsec(2);
send_previous(); send_previous();
//waitsec(2); //waitsec(2);
send_play(); // this should not be necessary, but just in case //send_play(); // this should not be necessary, but just in case
for(int t = 0; t < playtime; t++) { for(int t = 0; t < playtime; t++) {
// This will not give us perfect 1 second timing // This will not give us perfect 1 second timing
// but it is good enough for most video applications // but it is good enough for most video applications