Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Interval Shutter Release #51

Merged
merged 9 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.pio
.vscode
.vscode
src/furble.ino.cpp
44 changes: 44 additions & 0 deletions src/furble.ino
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,43 @@ static void about(void) {
ez.msgBox(FURBLE_STR " - About", "Version: " + version, "Back", true);
}

static void trigger(Furble::Device *device, int counter) {
device->focusPress();
delay(250);
device->shutterPress();
delay(50);

ez.msgBox("Interval Release", String(counter), "Stop", false);
device->shutterRelease();
}

static void remote_interval(Furble::Device *device) {
int i = 0;
int j = 1;

ez.msgBox("Interval Release", "", "Stop", false);
trigger(device, j);

while (true) {
i++;

M5.update();

if (M5.BtnB.wasReleased()) {
break;
}

if (i > 50) {
i = 0;
j++;

trigger(device, j);
}

delay(50);
}
}

static void remote_control(Furble::Device *device) {
Serial.println("Remote Control");

Expand Down Expand Up @@ -198,14 +235,20 @@ static void menu_remote(Furble::Device *device) {
ezMenu submenu(FURBLE_STR " - Connected");
submenu.buttons("OK#down");
submenu.addItem("Shutter");
submenu.addItem("Interval");
submenu.addItem("Disconnect");
submenu.downOnLast("first");

do {
submenu.runOnce();

if (submenu.pickName() == "Shutter") {
remote_control(device);
}

if (submenu.pickName() == "Interval") {
remote_interval(device);
}
} while (submenu.pickName() != "Disconnect");

device->disconnect();
Expand Down Expand Up @@ -286,6 +329,7 @@ void setup() {
#include <themes/mono_furble.h>

ez.begin();

uint8_t width = 4 * M5.Lcd.textWidth("5") + ez.theme->header_hmargin * 2;
ez.header.insert(CURRENT_POSITION, "current", width, current_draw_widget);
ez.header.insert(GPS_HEADER_POSITION, "gps", ez.theme->header_height * 0.8, gps_draw_widget);
Expand Down
Loading