Files
arduino-art/dawn/Synchronizer_Toshiba_SD590EKE/Synchronizer_Toshiba_SD590EKE.pde

113 lines
2.7 KiB
Plaintext

/* DVD IR Synchronizer for Toshiba SD590EKE V1.0
* Developed for Art Installation "Dawn" by Sigrun Hardardottir<sigrun@stalverk.is>
* Code written by Joe Foley <foley@ru.is>
* on 2013-09-08
*
* Based upon Sychronizer code by
* KHM 2010 / Martin Nawrath
* Kunsthochschule fuer Medien Koeln
* Academy of Media Arts Cologne
*
* Requires libraries:
* MsTimer2 http://playground.arduino.cc/Main/MsTimer2
* Arduino-IRremote https://github.com/shirriff/Arduino-IRremote
*
* 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 <MsTimer2.h>
#include <IRremote.h>
int pinGND=4; // Longer leg on the IR LED
int secs;
int playtime= 6*60+9; // set here ypur DVD title playtime in sec leave a little extra
//int playtime= 10; // testing
IRsend irsend;
void setup() {
pinMode(pinGND,OUTPUT);
Serial.begin(115200);
Serial.println("Toshiba DVD SD590EKE Synchronizer V1.0");
Serial.println("For \"Dawn\" by Sigrun Hardardottir");
Serial.println("Code by Joe Foley <foley@ru.is>");
Serial.print("Playtime: ");
secs=playtime;
Serial.print("sec:");
Serial.print(secs);
Serial.print(" / mm:ss ");
Serial.print(secs/60);
Serial.print(":");
Serial.print(secs % 60);
Serial.println("");
Serial.println("play");
send_play();
Serial.println("wait 7 seconds");
delay(7000);
secs=playtime;
}
/********************************************************************/
void loop() {
Serial.println("Sync");
Serial.println(" pause");
send_pause();
delay(2000);
Serial.println(" skip");
send_previous();
delay(2000);
Serial.println(" play");
send_play();
for(int t = 0; t < playtime; t++) {
Serial.print("sec:");
Serial.print(playtime);
Serial.print(" / mm:ss ");
Serial.print(t/60);
Serial.print(":");
Serial.print(t % 60);
Serial.println("");
delay(1000);
}
}
/********************************************************************/
void send_stop() {
// First comes the pre-data bits, then the command code
irsend.sendNEC(0xA25D28D7,32);
}
/********************************************************************/
void send_play() {
// First comes the pre-data bits, then the command code
irsend.sendNEC(0xA25DA857,32);
}
/********************************************************************/
void send_pause() {
// First comes the pre-data bits, then the command code
irsend.sendNEC(0xA25D00FF, 32);
}
/********************************************************************/
void send_previous() {
// First comes the pre-data bits, then the command code
irsend.sendNEC(0xA25DC43B, 32);
}