diff --git a/ino/mcopy_cam_canon_ble_nano/mcopy_cam_canon_ble_nano.ino b/ino/mcopy_cam_canon_ble_nano/mcopy_cam_canon_ble_nano.ino index 6b88f58..c4fa1da 100644 --- a/ino/mcopy_cam_canon_ble_nano/mcopy_cam_canon_ble_nano.ino +++ b/ino/mcopy_cam_canon_ble_nano/mcopy_cam_canon_ble_nano.ino @@ -34,7 +34,7 @@ volatile long blinkLast = 0; volatile long now; volatile long last = -1; -volatile long cameraFrame = 2000; +volatile long cameraFrame = 3000; volatile long start; volatile long end; @@ -43,6 +43,8 @@ volatile char cmdChar = 'z'; volatile char sChar = 'z'; volatile bool connectedOnce = false; +volatile String exposureString; +volatile long exposureTarget = 3000; void setup () { @@ -102,12 +104,25 @@ void cmd (char val) { camera_direction(true); } else if (val == mc.CAMERA_BACKWARD) { camera_direction(false); + } else if (val == mc.CAMERA_EXPOSURE) { + exposure(); } else if (val == mc.STATE) { state(); } cmdChar = 'z'; } +void exposure () { + exposureString = mc.getString(); + parseExposureString(); + cameraFrame = exposureTarget; + mc.confirm(mc.CAMERA_EXPOSURE); +} + +void parseExposureString () { + exposureTarget = exposureString.toInt(); +} + void s_cmd (char val) { if (val == 'C') { connected = true; diff --git a/ino/mcopy_cam_relay/mcopy_cam_relay.ino b/ino/mcopy_cam_relay/mcopy_cam_relay.ino index d717391..7f9cb47 100644 --- a/ino/mcopy_cam_relay/mcopy_cam_relay.ino +++ b/ino/mcopy_cam_relay/mcopy_cam_relay.ino @@ -32,6 +32,9 @@ volatile int cameraFrame = 2000; volatile char cmdChar = 'z'; volatile long now; +volatile String exposureString; +volatile long exposureTarget = 2000; + McopySerial mc; void setup () { @@ -68,11 +71,24 @@ void cmd (char val) { camera_direction(false); } else if (val == mc.CAMERA) { camera(); + } else if (val == mc.CAMERA_EXPOSURE) { + exposure(); } else if (val == mc.STATE) { state(); } } +void exposure () { + exposureString = mc.getString(); + parseExposureString(); + cameraFrame = exposureTarget; + mc.confirm(mc.CAMERA_EXPOSURE); +} + +void parseExposureString () { + exposureTarget = exposureString.toInt(); +} + //null route direction void camera_direction (boolean state) { if (state) {