// * Canon EOS Timelapse Remote Control // * LCD Parallax 2 Row x 16 Characters // * Copyleft 2006 Andreas Johansson // Variable declaration // LED int ledPin = 13; // LED connected to digital pin 13 int optoPin = 10; // Set countdown variables int hour = 0; int min = 0; int sec = 0; // LCD // clear the LCD void clearLCD(){ Serial.print(12, BYTE); delay(50); } // start a new line void newLine() { Serial.print(10, BYTE); } // End variable declaration void setup() { beginSerial(2400); // Turn the display ON, with cursor off and no blink Serial.print(22, BYTE); // Turn the display ON, with cursor off and character blink // Serial.print(23, BYTE); // Turn the display ON, with cursor on and no blink (Default) // Serial.print(24, BYTE); // Turn the display ON, with cursor on and character blink // Serial.print(25, BYTE); // Print startup text clearLCD(); Serial.print("Canon EOS Remote"); Serial.print("Andreas 2006"); delay(1000); clearLCD(); // Led pinMode(ledPin, OUTPUT); // sets the digital pin as output // Opto pinMode(optoPin, OUTPUT); // sets the digital pin as output // End void setup } // Void loop void loop() { Start: // Start counters hour = 0; min = 0; sec = 5; Seconds: if (hour == 0 && min == 0 && sec == 0) { goto TakePic; } if (sec > 0) { Serial.print("RUNNING"); if (hour <=9){ Serial.print("0"); } Serial.print(hour); Serial.print(":"); if (min <=9){ Serial.print("0"); } Serial.print(min); Serial.print(":"); if (sec <=9){ Serial.print("0"); } Serial.print(sec); delay(1000); newLine(); sec--; goto Seconds; } if (min !=0) { sec = 59; } Minutes: if (min >= 0) { min–; goto Seconds; } if (hour !=0) { min = 59; } Hours: if (hour >= 0) { hour–; goto Seconds; } TakePic: Serial.print("PICTURE 00:00:00"); digitalWrite(ledPin, HIGH); // sets the LED on digitalWrite(optoPin, HIGH); // sets the OPTO on delay(300); digitalWrite(optoPin, LOW); // sets the OPTP to off delay(700); digitalWrite(ledPin, LOW); // sets the LED off newLine(); goto Start; // End void loop }