Arduino Guide
Description:
Prototype:
bool begin()
Parameters:
None
Return Values:
Return Value | Description |
---|---|
true | Initialization successful |
false | Initialization failed |
Description:
Prototype:
bool get()
Parameters:
None
Return Values:
Return Value | Description |
---|---|
true | Image retrieval successful |
false | Image retrieval failed |
Description:
Prototype:
bool free()
Parameters:
None
Return Values:
Return Value | Description |
---|---|
true | Image resource freed successfully |
false | No resources to free |
Example:
#include "M5CoreS3.h"
#include "esp_camera.h"
void setup() {
auto cfg = M5.config();
CoreS3.begin(cfg);
if (!CoreS3.Camera.begin()) {
Serial.println("Camera Init Fail");
}
Serial.println("Camera Init Success");
CoreS3.Camera.sensor->set_framesize(CoreS3.Camera.sensor, FRAMESIZE_QVGA);
}
void loop() {
if (CoreS3.Camera.get()) {
CoreS3.Display.pushImage(0, 0, CoreS3.Display.width(),
CoreS3.Display.height(),
(uint16_t *)CoreS3.Camera.fb->buf);
CoreS3.Camera.free();
}
}