diff --git a/synchronizer/blu-ray/Sony_BDP_S790/Sony_BDP_S790.pde b/synchronizer/blu-ray/Sony_BDP_S790/Sony_BDP_S790.pde index 3eae702..d764252 100755 --- a/synchronizer/blu-ray/Sony_BDP_S790/Sony_BDP_S790.pde +++ b/synchronizer/blu-ray/Sony_BDP_S790/Sony_BDP_S790.pde @@ -1,7 +1,8 @@ -const string DESCRIPTION="IR Synchronizer for Sony Blu-ray player BDP-S790"; -const string AUTHOR="Joe Foley "; -const string REVISION="$Rev$"; -const string SVNID="$Id$"; +const String DESCRIPTION="IR Synchronizer for Sony Blu-ray player BDP-S790"; +const String AUTHOR="Joe Foley "; +const String SVN_REVISION="$Rev$"; +const String SVN_URL="$URL$"; +const String SVN_ID="$Id$"; /* Code written by Joe Foley on 2014-01-14 * * Requires libraries: @@ -24,12 +25,16 @@ int pinGND=4; // Longer leg on the IR LED int pinLED=13; // The heartbeat LED on the board int secs; -int heartbeat=0; +int heartbeat_state=0; -string INST_NAME=""; -string ARTIST=""; -string YEAR=""; -int playtime= 1*60+1; // set here your DVD title playtime in sec leave a little extra +String INST_NAME="Trajectories"; +String ARTIST="Sigurdur Gudjonsson (video) & Anna Thorvaldsdottir (sound)"; +String YEAR="2014"; +int videotime = 14*60+44; // set here your DVD title playtime in sec +int choptime = 3; // how much to chop at the end if the videos are + // not exactly the same length +int playtime = videotime - choptime; +int resetdelay = 3; // seconds from reset to playing from beginning IRsend irsend; @@ -43,11 +48,11 @@ void setup() { Serial.begin(115200); setTime(23,15,16,1,14,14); // set time to 23:15:16 Jan 14 2014 - Serial << DESCRIPTION << REVISION << endl; + Serial << DESCRIPTION << " " << SVN_REVISION << endl; Serial << "Code by " << AUTHOR << endl; Serial << "For \""<< INST_NAME << "\" by "<< ARTIST <<"(" << YEAR << ")" << endl; - Serial << URL << endl << ID << endl;; - Serial << "Playtime: " << endl; + Serial << SVN_URL << endl << SVN_ID << endl; + Serial << "Playtime: " << playtime << endl; secs=playtime; showtime(); @@ -56,36 +61,36 @@ void setup() { /********************************************************************/ void loop() { - heartbeat() + heartbeat(); } void heartbeat() { - if (heartbeat == 1) { + if (heartbeat_state == 1) { digitalWrite(pinLED, HIGH); - heartbeat = 0; + heartbeat_state = 0; } else { digitalWrite(pinLED, LOW); - heartbeat = 1; + heartbeat_state = 1; } Alarm.delay(1000); } void sync() { Serial << "Sync" << endl; - // The DVD player starts playing automatically, so we should pause it send_pause(); - waitsec(2); + waitsec(resetdelay); 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 // but it is good enough for most video applications // The most critical is having everything start at the // same time. showtime(); + } + */ } /**************************************************************/ diff --git a/synchronizer/installations/sync-labels.tex b/synchronizer/installations/sync-labels.tex index f39de3d..23c6a5f 100644 --- a/synchronizer/installations/sync-labels.tex +++ b/synchronizer/installations/sync-labels.tex @@ -40,7 +40,7 @@ % \begin{minipage}{75mm} \vspace*{0.1in} % {\large #2}\\ - {\bf #2}\\ + {\bf #2}\\ #3 % \end{minipage} \end{minipage} @@ -53,7 +53,7 @@ % \begin{minipage}{75mm} \vspace*{0.1in} % {\large #2}\\ - {\bf #2}\\ + {\bf #2}\\ #3 % \end{minipage} \end{minipage} @@ -66,9 +66,10 @@ %\lab{}{}{}{} \newcommand{\syncdesigner}{Synchronizer\\by Joe Foley $<$foley@ru.is$>$ +354-661-7658} -\labnoru{Dawn (6:09)}{By Sigrún Harðar}{Toshiba SD590EKE \syncdesigner}{1986} -\labnoru{Sarcity (20:58)}{By Þor Elís}{Philips DVP3142 \syncdesigner}{1981} -\labnoru{West (25:42)}{By Steina Vasulka}{Toshiba SD1091EKE \syncdesigner}{1983} +%\labnoru{Dawn (6:09)}{By Sigrún Harðar}{Toshiba SD590EKE \syncdesigner}{1986} +%\labnoru{Sarcity (20:58)}{By Þor Elís}{Philips DVP3142 \syncdesigner}{1981} +%\labnoru{West (25:42)}{By Steina Vasulka}{Toshiba SD1091EKE \syncdesigner}{1983} +\labnoru{Trajectories (14:44)}{By Sigurður Guðjónsson (video) \& Anna Thorvaldsdóttir (sound)}{Sony BDP-S790 \syncdesigner}{2014} %\input{label-input.tex} \end{document} diff --git a/synchronizer/installations/trajectories_sony_bdp_s790/trajectories_sony_bdp_s790.pde b/synchronizer/installations/trajectories_sony_bdp_s790/trajectories_sony_bdp_s790.pde new file mode 100755 index 0000000..d764252 --- /dev/null +++ b/synchronizer/installations/trajectories_sony_bdp_s790/trajectories_sony_bdp_s790.pde @@ -0,0 +1,132 @@ +const String DESCRIPTION="IR Synchronizer for Sony Blu-ray player BDP-S790"; +const String AUTHOR="Joe Foley "; +const String SVN_REVISION="$Rev$"; +const String SVN_URL="$URL$"; +const String SVN_ID="$Id$"; +/* Code written by Joe Foley on 2014-01-14 + * + * Requires libraries: + * Arduino-IRremote https://github.com/shirriff/Arduino-IRremote + * Streaming http://arduiniana.org/libraries/streaming/ + * More codes at http://www.lirc.org/ + * This uses remote Sony RMT-B122P + * + * 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) + * + * + */ + +#include +#include +#include +#include +int pinGND=4; // Longer leg on the IR LED +int pinLED=13; // The heartbeat LED on the board + +int secs; +int heartbeat_state=0; + +String INST_NAME="Trajectories"; +String ARTIST="Sigurdur Gudjonsson (video) & Anna Thorvaldsdottir (sound)"; +String YEAR="2014"; +int videotime = 14*60+44; // set here your DVD title playtime in sec +int choptime = 3; // how much to chop at the end if the videos are + // not exactly the same length +int playtime = videotime - choptime; +int resetdelay = 3; // seconds from reset to playing from beginning + +IRsend irsend; + +void showtime() { + Serial << "sec:" << secs << " / mm:ss " << secs/60 << ":" << secs % 60 << endl; +} + +void setup() { + pinMode(pinGND,OUTPUT); + pinMode(pinLED,OUTPUT); + Serial.begin(115200); + setTime(23,15,16,1,14,14); // set time to 23:15:16 Jan 14 2014 + + Serial << DESCRIPTION << " " << SVN_REVISION << endl; + Serial << "Code by " << AUTHOR << endl; + Serial << "For \""<< INST_NAME << "\" by "<< ARTIST <<"(" << YEAR << ")" << endl; + Serial << SVN_URL << endl << SVN_ID << endl; + Serial << "Playtime: " << playtime << endl; + secs=playtime; + showtime(); + + Alarm.timerRepeat(playtime, sync); +} + +/********************************************************************/ +void loop() { + heartbeat(); +} + +void heartbeat() { + if (heartbeat_state == 1) { + digitalWrite(pinLED, HIGH); + heartbeat_state = 0; + } + else { + digitalWrite(pinLED, LOW); + heartbeat_state = 1; + } + Alarm.delay(1000); +} + +void sync() { + Serial << "Sync" << endl; + send_pause(); + waitsec(resetdelay); + + send_previous(); + + /* for(int t = 0; t < playtime; t++) { + // This will not give us perfect 1 second timing + // but it is good enough for most video applications + // The most critical is having everything start at the + // same time. + showtime(); + } + */ +} + +/**************************************************************/ +void waitsec(int sec) { + Serial << "Wait " << sec << " seconds" << endl; + Alarm.delay(sec*1000); +} + + +/********************************************************************/ + // NEC data format: first comes the pre-data bits, then the command code +void send_stop() { + Serial << " stop" << endl; + irsend.sendNEC(0xA25D28D7,32); +} + +/********************************************************************/ +void send_play() { + // Note that play and pause are a toggle for the same command + Serial << " play" << endl; + irsend.sendNEC(0xA25DA857, 32); + +} + +/********************************************************************/ +void send_pause() { + // On this model, pause and play are the same button so it toggles + // We use the "step" command which will always pause, no matter + // how many times we press it. + Serial << " step/pause" << endl; + irsend.sendNEC(0xA25D00FF,32); +} + +/********************************************************************/ +void send_previous() { + // First comes the pre-data bits, then the command code + Serial.println(" previous"); + irsend.sendNEC(0xA25DC43B, 32); +}