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

make it compile #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion TimeLapse/TimeLapse.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ void setup()
Serial.println();
initFileSystem();
initCamera();




// startLapse(); -------- IF YOU WANT AUTO START THE TIMELAPSE


WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
Expand All @@ -28,6 +33,8 @@ void setup()
Serial.print("Camera Ready! Use 'http://");
Serial.print(WiFi.localIP());
Serial.println("' to connect");


}

void loop()
Expand Down
6 changes: 3 additions & 3 deletions TimeLapse/app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ static esp_err_t capture_handler(httpd_req_t *req)

static esp_err_t startLapseHandler(httpd_req_t *req)
{
startLapse();
return startLapse();
}

static esp_err_t stopLapseHandler(httpd_req_t *req)
{
stopLapse();
return stopLapse();
}

static esp_err_t streamHandler(httpd_req_t *req)
Expand Down Expand Up @@ -302,7 +302,7 @@ static esp_err_t status_handler(httpd_req_t *req)
p += sprintf(p, "\"hmirror\":%u,", s->status.hmirror);
p += sprintf(p, "\"dcw\":%u,", s->status.dcw);
p += sprintf(p, "\"colorbar\":%u,", s->status.colorbar);
p += sprintf(p, "\"interval\":%u,", interval);
p += sprintf(p, "\"interval\":%u,", (int)interval);
*p++ = '}';
*p++ = 0;
httpd_resp_set_type(req, "application/json");
Expand Down
2 changes: 1 addition & 1 deletion TimeLapse/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ bool initCamera()
s->set_saturation(s, -2); //lower the saturation
}
//drop down frame size for higher initial frame rate
s->set_framesize(s, FRAMESIZE_QVGA);
s->set_framesize(s, FRAMESIZE_UXGA);

#if defined(CAMERA_MODEL_M5STACK_WIDE)
s->set_vflip(s, 1);
Expand Down
Empty file modified TimeLapse/camera.h
100644 → 100755
Empty file.
Empty file modified TimeLapse/camera_pins.h
100644 → 100755
Empty file.
Empty file modified TimeLapse/file.cpp
100644 → 100755
Empty file.
Empty file modified TimeLapse/file.h
100644 → 100755
Empty file.
Empty file modified TimeLapse/index.h
100644 → 100755
Empty file.
7 changes: 4 additions & 3 deletions TimeLapse/lapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

unsigned long fileIndex = 0;
unsigned long lapseIndex = 0;
unsigned long frameInterval = 1000;
unsigned long frameInterval = 10000;
bool mjpeg = true;
bool lapseRunning = false;
unsigned long lastFrameDelta = 0;
Expand All @@ -22,7 +22,7 @@ bool startLapse()
char path[32];
for(; lapseIndex < 10000; lapseIndex++)
{
sprintf(path, "/lapse%03d", lapseIndex);
sprintf(path, "/lapse%03d", (int)lapseIndex);
if (!fileExists(path))
{
createDir(path);
Expand All @@ -37,6 +37,7 @@ bool startLapse()
bool stopLapse()
{
lapseRunning = false;
return lapseRunning;
}

bool processLapse(unsigned long dt)
Expand All @@ -57,7 +58,7 @@ bool processLapse(unsigned long dt)
}

char path[32];
sprintf(path, "/lapse%03d/pic%05d.jpg", lapseIndex, fileIndex);
sprintf(path, "/lapse%03d/pic%05d.jpg", (int)lapseIndex, (int)fileIndex);
Serial.println(path);
if(!writeFile(path, (const unsigned char *)fb->buf, fb->len))
{
Expand Down
Empty file modified TimeLapse/lapse.h
100644 → 100755
Empty file.