Interval Shutter Program Ver.3

Dependencies:   mbed

Fork of IntervalShutter2 by Honmaka Astro

Files at this revision

API Documentation at this revision

Comitter:
Honmaka
Date:
Sat Jan 31 07:17:24 2015 +0000
Parent:
1:ca34f8960f93
Commit message:
IntervalShutter3

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ca34f8960f93 -r 11af47fce11c main.cpp
--- a/main.cpp	Tue Jan 27 12:41:50 2015 +0000
+++ b/main.cpp	Sat Jan 31 07:17:24 2015 +0000
@@ -6,8 +6,18 @@
 
 int main() {
     Input.mode(PullDown);
+    int PreInput = 0;
+    int NowInput;
+    Camera1 = 0;
+    Camera2 = 0;
     while(1) {
-        Camera1 = Input;
-        Camera2 = Input;
+        NowInput = Input;
+        if (NowInput != PreInput) {
+            Camera1 = NowInput;
+            wait(1);
+            Camera2 = NowInput;
+        }
+        PreInput = NowInput;
+        wait(0.1);
     }
 }