Permalink
Browse files

added footswitch (and changed some pins)

  • Loading branch information...
ladyada committed Oct 6, 2010
1 parent 166b4dc commit 694c22a6f8e4e7e3eb31c4c851ca54218adc990d
Showing with 12 additions and 5 deletions.
  1. +12 −5 intervalometer.pde
View
@@ -2,24 +2,31 @@
// See the full tutorial at http://www.ladyada.net/learn/sensors/ir.html
// this code is public domain, please enjoy!
-int IRledPin = 13; // LED connected to digital pin 13
+int IRledPin = 12; // LED connected to digital pin 12
+int buttonPin = 3; // footswitch connected to digital #3
// The setup() method runs once, when the sketch starts
void setup() {
// initialize the IR digital pin as an output:
pinMode(IRledPin, OUTPUT);
+ pinMode(buttonPin, INPUT);
+ digitalWrite(buttonPin, HIGH); // pullup on
+
Serial.begin(9600);
}
void loop()
{
- Serial.println("Sending IR signal");
+ if (! digitalRead(buttonPin)) {
+ // footswitch pressed
+ Serial.println("Sending IR signal");
- SendCanonCode();
-
- delay(60*1000); // wait one minute (60 seconds * 1000 milliseconds)
+ SendCanonCode();
+
+ delay(3*1000); // wait 3 seconds (* 1000 milliseconds)
+ }
}
// This procedure sends a 38KHz pulse to the IRledPin

0 comments on commit 694c22a

Please sign in to comment.