From bbf0cbd1c6f3ec4e95ffafc015cd5125f6536f5f Mon Sep 17 00:00:00 2001 From: Matthew McWilliams Date: Tue, 11 Apr 2023 23:43:35 -0400 Subject: [PATCH] Add the button to the relay sketch --- ino/mcopy_cam_relay/mcopy_cam_relay.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ino/mcopy_cam_relay/mcopy_cam_relay.ino b/ino/mcopy_cam_relay/mcopy_cam_relay.ino index 4754e53..ca766cb 100644 --- a/ino/mcopy_cam_relay/mcopy_cam_relay.ino +++ b/ino/mcopy_cam_relay/mcopy_cam_relay.ino @@ -22,6 +22,7 @@ //CAMERA CONSTANTS const int CAMERA = 2; +const int BUTTON = 7; const int LED = 8; const int CAMERA_MOMENT = 240; @@ -45,11 +46,15 @@ void loop () { now = millis(); cmdChar = mc.loop(); cmd(cmdChar); + if (digitalRead(BUTTON) == LOW) { + camera(); + } } void pins () { pinMode(CAMERA, OUTPUT); pinMode(LED, OUTPUT); + pinMode(BUTTON, INPUT_PULLUP); digitalWrite(CAMERA, HIGH); digitalWrite(LED, LOW);