2020-01-14 03:32:54 +00:00
|
|
|
#include <WiFi.h>
|
|
|
|
#include "file.h"
|
|
|
|
#include "camera.h"
|
|
|
|
#include "lapse.h"
|
|
|
|
|
2020-01-30 15:26:14 +00:00
|
|
|
const char *ssid = "...";
|
|
|
|
const char *password = "...";
|
2020-01-14 03:32:54 +00:00
|
|
|
|
|
|
|
void startCameraServer();
|
|
|
|
|
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
|
|
|
Serial.setDebugOutput(true);
|
|
|
|
Serial.println();
|
|
|
|
initFileSystem();
|
|
|
|
initCamera();
|
2020-01-30 15:26:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// startLapse(); -------- IF YOU WANT AUTO START THE TIMELAPSE
|
|
|
|
|
|
|
|
|
2020-01-14 03:32:54 +00:00
|
|
|
WiFi.begin(ssid, password);
|
|
|
|
while (WiFi.status() != WL_CONNECTED)
|
|
|
|
{
|
|
|
|
delay(500);
|
|
|
|
Serial.print(".");
|
|
|
|
}
|
|
|
|
Serial.println("");
|
|
|
|
Serial.println("WiFi connected");
|
|
|
|
startCameraServer();
|
|
|
|
Serial.print("Camera Ready! Use 'http://");
|
|
|
|
Serial.print(WiFi.localIP());
|
|
|
|
Serial.println("' to connect");
|
2020-01-30 15:23:39 +00:00
|
|
|
|
2020-01-30 15:26:14 +00:00
|
|
|
|
2020-01-14 03:32:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
unsigned long t = millis();
|
|
|
|
static unsigned long ot = 0;
|
|
|
|
unsigned long dt = t - ot;
|
|
|
|
ot = t;
|
|
|
|
processLapse(dt);
|
|
|
|
}
|