Skip to content

Commit

Permalink
Enter shutter lock if release and focus are both pressed.
Browse files Browse the repository at this point in the history
During remote control, if focus button is held and release is pressed,
enter shutter lock.
Exit shutter lock if either focus or release are clicked.
  • Loading branch information
gkoh committed Feb 29, 2024
1 parent 26143b7 commit 6fbb009
Showing 1 changed file with 46 additions and 24 deletions.
70 changes: 46 additions & 24 deletions src/furble.ino
Original file line number Diff line number Diff line change
Expand Up @@ -167,45 +167,67 @@ static void remote_interval(Furble::Device *device) {
}

static void remote_control(Furble::Device *device) {

static bool shutter_lock = false;

Serial.println("Remote Control");

#ifdef M5STACK_CORE2
ez.msgBox("Remote Shutter", "", "Release#Focus#Back", false);
ez.msgBox("Remote Shutter", "Lock: Focus+Release", "Release#Focus#Back", false);
#else
ez.msgBox("Remote Shutter", "Back: Power", "Release#Focus", false);
ez.msgBox("Remote Shutter", "Lock: Focus+Release\nBack: Power", "Release#Focus", false);
#endif
do {
M5.update();

update_geodata(device);

if (M5.BtnPWR.wasClicked() || M5.BtnC.wasPressed()) {
if (shutter_lock) {
// ensure shutter is released on exit
device->shutterRelease();
}
Serial.println("Exit shutter");
break;
}

if (M5.BtnA.wasPressed()) {
device->shutterPress();
Serial.println("shutterPress()");
continue;
}

if (M5.BtnA.wasReleased()) {
device->shutterRelease();
Serial.println("shutterRelease()");
continue;
}

if (M5.BtnB.wasPressed()) {
device->focusPress();
Serial.println("focusPress()");
continue;
}

if (M5.BtnB.wasReleased()) {
device->focusRelease();
Serial.println("focusRelease()");
continue;
if (shutter_lock) {
// release shutter if either shutter or focus is pressed
if (M5.BtnA.wasClicked() || M5.BtnB.wasClicked()) {
shutter_lock = false;
device->shutterRelease();
Serial.println("shutterRelease(unlock)");
}
} else {
if (M5.BtnA.wasPressed()) {
device->shutterPress();
Serial.println("shutterPress()");
continue;
}

if (M5.BtnA.wasReleased()) {
// focus + shutter = shutter lock
if (M5.BtnB.isPressed()) {
shutter_lock = true;
Serial.println("shutter lock");
} else {
device->shutterRelease();
Serial.println("shutterRelease()");
}
continue;
}

if (M5.BtnB.wasPressed()) {
device->focusPress();
Serial.println("focusPress()");
continue;
}

if (M5.BtnB.wasReleased()) {
device->focusRelease();
Serial.println("focusRelease()");
continue;
}
}

ez.yield();
Expand Down

0 comments on commit 6fbb009

Please sign in to comment.