Skip to content

Commit 089cbe2

Browse files
authored
Merge pull request #656 from sebromero/sebromero/camera-docs
[AE-39] Add API documentation to Camera library
2 parents 8e0a044 + acf090c commit 089cbe2

File tree

7 files changed

+1038
-30
lines changed

7 files changed

+1038
-30
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ cores/arduino/api/
22
cores/arduino/api*
33
**/.vscode/
44
**/.development
5+
.DS_Store

Diff for: libraries/Camera/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 📹 Library for Arduino Supported Cameras
2+
3+
The Arduino camera library captures pixels from supported cameras on Arduino boards and stores them in a buffer for continuous retrieval and processing.
4+
5+
📖 For more information about this library please read the documentation [here](./docs/).

Diff for: libraries/Camera/docs/README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Arduino Camera Library
2+
3+
[![License](https://img.shields.io/badge/License-LGPLv3-blue.svg)](https://github.com/arduino/ArduinoCore-mbed/blob/master/libraries/Camera/LICENSE)
4+
5+
The Arduino camera library is a C++ library designed to capture pixels from cameras on supported Arduino products. It is currently compatible with three camera models:
6+
7+
- OmniVision OV7670 (On the [Arduino Giga R1](https://docs.arduino.cc/hardware/giga-r1-wifi))
8+
- Himax HM01B0 & HM0360 (On the [Arduino Portenta Vision Shield](https://docs.arduino.cc/hardware/portenta-vision-shield))
9+
- Galaxy Core GC2145 (On the [Arduino Nicla Vision](https://docs.arduino.cc/hardware/nicla-vision))
10+
11+
This library captures pixels and stores them in a frame buffer. The frames can then be retrieved continuously for processing.
12+
13+
The library provides methods to initialize the camera, capture frames, and access the pixels in the frame buffer. It supports various configuration options, such as setting the resolution and format of the captured frames. Please note that not all configurations are available for all cameras. The Himax camera for example only supports grayscale.
14+
15+
## Features
16+
17+
- Captures pixels and stores them in a frame buffer
18+
- Store frame buffer on external RAM
19+
- Frames can be retrieved continuously for processing
20+
- Supports configuration options such as resolution and format
21+
- Motion detection callback on supported camera (Himax HM0360)
22+
- Simulated optical zoom on supported camera (GC2145)
23+
24+
25+
## Usage
26+
27+
To use this library, you must have a supported Arduino board and camera module. Once you have connected the camera to the board, you can include the camera library in your Arduino sketch and use its functions to capture frames and access the pixels. Here is a minimal example for the Arduino Nicla Vision:
28+
29+
```cpp
30+
#include "camera.h"
31+
#include "gc2145.h"
32+
33+
GC2145 galaxyCore;
34+
Camera cam(galaxyCore);
35+
FrameBuffer fb;
36+
37+
void setup() {
38+
cam.begin(CAMERA_R320x240, CAMERA_RGB565, 30);
39+
}
40+
41+
void loop() {
42+
if (cam.grabFrame(fb, 3000) == 0) {
43+
// Do something with the frame, e.g. send it over serial
44+
Serial.write(fb.getBuffer(), cam.frameSize());
45+
}
46+
}
47+
```
48+
## Examples
49+
50+
- **CameraRawBytes:** This example demonstrates how to capture raw bytes from the camera and display them on the computer by using a [Processing](https://processing.org/download) sketch. It uses UART to communicate with Processing and the `Camera` library to capture and retrieve the raw bytes.
51+
The Processing sketch can be found [here](../extras/CameraRawBytesVisualizer/CameraRawBytesVisualizer.pde).
52+
- **MotionDetection:** This example shows how to use the camera to detect motion in the captured frames on the camera. If motion is detected, a callback function is executed in an interrupt context.
53+
- **GigaCamera:** This example demonstrates how to use the camera on the Arduino Giga R1 to capture images and display them on an attached LCD display that is driven by a ST7701 controller.
54+
55+
## API
56+
57+
The API documentation can be found [here](./api.md).
58+
59+
## License
60+
61+
This library is released under the [LGPLv3 license](https://github.com/arduino/ArduinoCore-mbed/blob/master/libraries/Camera/LICENSE).

0 commit comments

Comments
 (0)