took out the extra pauses in the Toshiba SD590EKE. Removed the timer include (not needed). Updated the information in the branched SD1091 code. Finished implementation and testing of the SD1091 code. Added a space to the formatting of the second timer UI output.

This commit is contained in:
foley@ru.is
2013-09-10 21:08:23 +00:00
parent ed5cbf7667
commit 4176b75d05
4 changed files with 44 additions and 59 deletions

View File

@@ -1,29 +1,29 @@
/* DVD IR Synchronizer for Toshiba SD590EKE V1.0 /* DVD IR Synchronizer for Toshiba SD1091EKE
* Developed for Art Installation "Dawn" by Sigrun Hardardottir<sigrun@stalverk.is> * Developed for Art Installation by Steina
* Code written by Joe Foley <foley@ru.is> * Code written by Joe Foley <foley@ru.is>
* on 2013-09-08 * on 2013-09-08
* *
* Based upon Sychronizer code by
* KHM 2010 / Martin Nawrath
* Kunsthochschule fuer Medien Koeln
* Academy of Media Arts Cologne
*
* Requires libraries: * Requires libraries:
* MsTimer2 http://playground.arduino.cc/Main/MsTimer2
* Arduino-IRremote https://github.com/shirriff/Arduino-IRremote * Arduino-IRremote https://github.com/shirriff/Arduino-IRremote
* *
* More codes at http://www.lirc.org/
* The compatible remote is SE-R0301
* We use the codes for the SE-R0031
* http://lirc.sourceforge.net/remotes/toshiba/SE-R0031
* Note that this has some similar codes
*
* The IRremote library uses Pin 3 for the Anode (longer pin) * The IRremote library uses Pin 3 for the Anode (longer pin)
* We have made a ground pin on Pin 4 for the Cathode (shorter pin) * We have made a ground pin on Pin 4 for the Cathode (shorter pin)
*
*
*/ */
#include <MsTimer2.h>
#include <IRremote.h> #include <IRremote.h>
int pinGND=4; // Longer leg on the IR LED int pinGND=4; // Longer leg on the IR LED
int secs; int secs;
int playtime= 6*60+9; // set here ypur DVD title playtime in sec leave a little extra int playtime= 1*60; // set here ypur DVD title playtime in sec leave a little extra
//int playtime= 10; // testing //int playtime= 10; // testing
IRsend irsend; IRsend irsend;
@@ -32,8 +32,8 @@ void setup() {
pinMode(pinGND,OUTPUT); pinMode(pinGND,OUTPUT);
Serial.begin(115200); Serial.begin(115200);
Serial.println("Toshiba DVD SD590EKE Synchronizer $Rev$"); Serial.println("Toshiba DVD SD1091EKE Synchronizer $Rev$");
Serial.println("For \"Dawn\" by Sigrun Hardardottir"); Serial.println("For Steina");
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$");
@@ -49,9 +49,7 @@ void setup() {
// The DVD player starts playing automatically, so we should pause it // The DVD player starts playing automatically, so we should pause it
send_pause(); send_pause();
waitsec(1); waitsec(3);
send_pause();
waitsec(2);
secs=playtime; secs=playtime;
} }
@@ -59,7 +57,8 @@ void setup() {
/********************************************************************/ /********************************************************************/
void loop() { void loop() {
Serial.println("Sync"); Serial.println("Sync");
send_play(); send_previous();
// on this model, previous immediately starts playing
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
@@ -79,41 +78,39 @@ void loop() {
send_pause(); send_pause();
waitsec(1); waitsec(1);
send_pause();
waitsec(2);
send_previous();
waitsec(5);
} }
/**************************************************************/ /**************************************************************/
void waitsec(int sec) { void waitsec(int sec) {
Serial.print("wait"); Serial.print("Wait ");
Serial.print(sec); Serial.print(sec);
Serial.println("seconds"); Serial.println(" seconds");
delay(sec*1000); delay(sec*1000);
} }
/********************************************************************/ /********************************************************************/
// NEC data format: first comes the pre-data bits, then the command code
void send_stop() { void send_stop() {
// First comes the pre-data bits, then the command code
Serial.println(" stop"); Serial.println(" stop");
irsend.sendNEC(0xA25D28D7,32); irsend.sendNEC(0xA25D28D7,32);
} }
/********************************************************************/ /********************************************************************/
void send_play() { void send_play() {
// First comes the pre-data bits, then the command code // Note that play and pause are a toggle for the same command
Serial.println(" play"); Serial.println(" play");
irsend.sendNEC(0xA25DA857,32); irsend.sendNEC(0xA25DA857, 32);
} }
/********************************************************************/ /********************************************************************/
void send_pause() { void send_pause() {
// First comes the pre-data bits, then the command code // On this model, pause and play are the same button so it toggles
Serial.println(" pause"); // We use the "step" command which will always pause, no matter
irsend.sendNEC(0xA25D00FF, 32); // how many times we press it.
Serial.println(" step/pause");
irsend.sendNEC(0xA25D00FF,32);
} }
/********************************************************************/ /********************************************************************/

View File

@@ -1,23 +1,19 @@
/* DVD IR Synchronizer for Toshiba SD590EKE V1.0 /* DVD IR Synchronizer for Toshiba SD590EKE
* Developed for Art Installation "Dawn" by Sigrun Hardardottir<sigrun@stalverk.is> * Developed for Art Installation "Dawn" by Sigrun Hardardottir<sigrun@stalverk.is>
* Code written by Joe Foley <foley@ru.is> * Code written by Joe Foley <foley@ru.is>
* on 2013-09-08 * on 2013-09-08
* *
* Based upon Sychronizer code by
* KHM 2010 / Martin Nawrath
* Kunsthochschule fuer Medien Koeln
* Academy of Media Arts Cologne
*
* Requires libraries: * Requires libraries:
* MsTimer2 http://playground.arduino.cc/Main/MsTimer2
* Arduino-IRremote https://github.com/shirriff/Arduino-IRremote * Arduino-IRremote https://github.com/shirriff/Arduino-IRremote
* *
* IR Remote codes from SE-R0313
* http://lirc.sourceforge.net/remotes/toshiba/SE-R0313
*
* The IRremote library uses Pin 3 for the Anode (longer pin) * The IRremote library uses Pin 3 for the Anode (longer pin)
* We have made a ground pin on Pin 4 for the Cathode (shorter pin) * We have made a ground pin on Pin 4 for the Cathode (shorter pin)
*/ */
#include <MsTimer2.h>
#include <IRremote.h> #include <IRremote.h>
int pinGND=4; // Longer leg on the IR LED int pinGND=4; // Longer leg on the IR LED
@@ -49,9 +45,7 @@ void setup() {
// The DVD player starts playing automatically, so we should pause it // The DVD player starts playing automatically, so we should pause it
send_pause(); send_pause();
waitsec(1); waitsec(2);
send_pause();
waitsec(1);
secs=playtime; secs=playtime;
} }
@@ -60,7 +54,7 @@ void setup() {
void loop() { void loop() {
Serial.println("Sync"); Serial.println("Sync");
send_previous(); send_previous();
waitsec(3); waitsec(2);
send_play(); send_play();
for(int t = 0; t < playtime; t++) { for(int t = 0; t < playtime; t++) {
@@ -81,16 +75,13 @@ void loop() {
send_pause(); send_pause();
waitsec(1); waitsec(1);
send_pause();
waitsec(1);
} }
/**************************************************************/ /**************************************************************/
void waitsec(int sec) { void waitsec(int sec) {
Serial.print("wait"); Serial.print("Wait ");
Serial.print(sec); Serial.print(sec);
Serial.println("seconds"); Serial.println(" seconds");
delay(sec*1000); delay(sec*1000);
} }

View File

@@ -1,8 +0,0 @@
{\rtf1\mac\ansicpg10000\cocoartf949\cocoasubrtf540
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww13280\viewh7500\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
\f0\fs24 \cf0 to install arduino libraries unzip them into Documents/Arduino/libraries\
}

5
dawn/readme.txt Normal file
View File

@@ -0,0 +1,5 @@
To install arduino libraries put them in
Documents/Arduino/libraries
Directions on setting up the IR remote system are at
http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html