Skip to content

pinout.h updated to accomodate the ESP32S3 Sense Seed Studio #59

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

Open
wants to merge 2 commits into
base: main
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
192 changes: 1 addition & 191 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,191 +1 @@
# Unleash the full power of you ESP32 camera

This Arduino library kickstarts your ESP32 camera projects
by providing you a set of tools to easily interact your the camera.

## Take a picture

Forget complex configurations and verbose code.

```cpp
#include <eloquent_esp32cam.h>

using eloq::camera;

void setup() {
delay(3000);
Serial.begin(115200);
Serial.println("___GET YOUR FIRST PICTURE___");

camera.pinout.aithinker();
camera.brownout.disable();
camera.resolution.vga();

while (!camera.begin().isOk())
Serial.println(camera.exception.toString());
}

void loop() {
if (!camera.capture().isOk()) {
Serial.println(camera.exception.toString());
return;
}

Serial.printf(
"JPEG size in bytes: %d. Width: %dpx. Height: %dpx.\n",
camera.getSizeInBytes(),
camera.resolution.getWidth(),
camera.resolution.getHeight()
);
}
```

## Save picture to SD card

Timestamped file storage on your SD card that you can finally understand!

```cpp
#include <eloquent_esp32cam.h>
#include <eloquent_esp32cam/extra/esp32/ntp.h>
#include <eloquent_esp32cam/extra/esp32/fs/sdmmc.h>

void setup() {
delay(3000);
Serial.begin(115200);
Serial.println("___SAVE PIC TO SD CARD___");

camera.pinout.freenove_s3();
camera.brownout.disable();
camera.resolution.vga();
camera.quality.high();

ntp.offsetFromGreenwhich(0);
ntp.isDaylight();
ntp.server("pool.ntp.org");

// init camera
while (!camera.begin().isOk())
Serial.println(camera.exception.toString());

// init SD
while (!sdmmc.begin().isOk())
Serial.println(sdmmc.exception.toString());

// connect to WiFi to sync NTP
while (!wifi.connect().isOk())
Serial.println(wifi.exception.toString());

// get NTP time
while (!ntp.begin().isOk())
Serial.println(ntp.exception.toString());

Serial.println("Camera OK");
Serial.println("SD card OK");
Serial.println("NTP OK");
Serial.print("Current time is ");
Serial.println(ntp.datetime());
}

void loop() {
if (!camera.capture().isOk()) {
Serial.println(camera.exception.toString());
return;
}

// save under nested directory
String date = ntp.date();
String datetime = ntp.datetime();

if (sdmmc.save(camera.frame).inside(date).to(datetime, "jpg").isOk()) {
Serial.print("File written to ");
Serial.println(sdmmc.session.lastFilename);
}
else Serial.println(sdmmc.session.exception.toString());
}
```

## Object detection

Running Edge Impulse FOMO object detection is a piece of cake.

```cpp
#include <your-fomo-project_inferencing.h>
#include <eloquent_esp32cam.h>
#include <eloquent_esp32cam/edgeimpulse/fomo.h>

using eloq::camera;
using eloq::ei::fomo;

void setup() {
delay(3000);
Serial.begin(115200);
Serial.println("__EDGE IMPULSE FOMO (NO-PSRAM)__");

// camera settings
camera.pinout.freenove_s3();
camera.brownout.disable();
camera.resolution.yolo();
camera.pixformat.rgb565();

// init camera
while (!camera.begin().isOk())
Serial.println(camera.exception.toString());

Serial.println("Camera OK");
Serial.println("Put object in front of camera");
}


void loop() {
if (!camera.capture().isOk()) {
Serial.println(camera.exception.toString());
return;
}

// run FOMO
if (!fomo.run().isOk()) {
Serial.println(fomo.exception.toString());
return;
}

// how many objects were found?
Serial.printf(
"Found %d object(s) in %dms\n",
fomo.count(),
fomo.benchmark.millis()
);

// if no object is detected, return
if (!fomo.foundAnyObject())
return;

// if you expect to find a single object, use fomo.first
Serial.printf(
"Found %s at (x = %d, y = %d) (size %d x %d). "
"Proba is %.2f\n",
fomo.first.label,
fomo.first.x,
fomo.first.y,
fomo.first.width,
fomo.first.height,
fomo.first.proba
);

// if you expect to find many objects, use fomo.forEach
if (fomo.count() > 1) {
fomo.forEach([](int i, bbox_t bbox) {
Serial.printf(
"#%d) Found %s at (x = %d, y = %d) (size %d x %d). "
"Proba is %.2f\n",
i + 1,
bbox.label,
bbox.x,
bbox.y,
bbox.width,
bbox.height,
bbox.proba
);
});
}
}
```
RoboSoccer Camera Object Detection
24 changes: 24 additions & 0 deletions src/eloquent_esp32cam/camera/pinout.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,30 @@ namespace Eloquent {
return true;
}

/**
*
*/
bool robosoccer_esp32_s3() {
pins.d0 = 15;
pins.d1 = 17;
pins.d2 = 18;
pins.d3 = 16;
pins.d4 = 14;
pins.d5 = 12;
pins.d6 = 11;
pins.d7 = 48;
pins.xclk = 10;
pins.pclk = 13;
pins.vsync = 38;
pins.href = 47;
pins.sccb_sda = 40;
pins.sccb_scl = 39;
pins.pwdn = -1;
pins.reset = -1;
pins.flashlight = -1;
return true;
}

/**
*
*/
Expand Down