diff --git a/README.md b/README.md index aed81aa..11aef9c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you want to play arround with AI, take a look at the [micropython binding for ## Content -- [Precompiled firmware (the easy way)](#Precompiled-firmware-the-easy-way) +- [Precompiled firmware (the easy way)](#precompiled-firmware-the-easy-way) - [Using the API](#using-the-api) - [Importing the camera module](#importing-the-camera-module) - [Creating a camera object](#creating-a-camera-object) @@ -22,7 +22,7 @@ If you want to play arround with AI, take a look at the [micropython binding for - [Camera reconfiguration](#camera-reconfiguration) - [Freeing the buffer](#freeing-the-buffer) - [Is a frame available](#is-frame-available) - - [Additional methods](#additional-methods) + - [Additional methods and examples](#additional-methods-and-examples) - [I2C Integration](#i2c-integration) - [Additional information](#additional-information) - [Build your custom firmware](#build-your-custom-firmware) @@ -130,10 +130,14 @@ The following keyword arguments have default values: ### Initializing the camera +The camera initializes when constructing the camera object per default. If you set init=False during construction, you need to call the init method manually: + ```python cam.init() ``` +Note that most of the camera seeting can only be set or aquired after initialization. + ### Capture image The general way of capturing an image is calling the `capture` method: @@ -192,14 +196,14 @@ This gives you the possibility of creating an asynchronous application without u Here are just a few examples: ```python -cam.set_quality(90) # The quality goes from 0% to 100%, meaning 100% is the highest but has probably no compression -camera.get_brightness() -camera.set_vflip(True) #Enable vertical flip +cam.quality = 90 # The quality goes from 0% to 100%, meaning 100% is the highest but has probably no compression +print("cam.brightness =", cam.brightness) +camera.vflip = True #Enable vertical flip ``` See autocompletions in Thonny in order to see the list of methods. -If you want more insights in the methods and what they actually do, you can find a very good documentation [here](https://docs.circuitpython.org/en/latest/shared-bindings/espcamera/index.html). -Note that each method requires a "get_" or "set_" prefix, depending on the desired action. +If you want more insights in the methods and what they actually do, you can find a very good documentation [in circuitpython](https://docs.circuitpython.org/en/latest/shared-bindings/espcamera/index.html). +Note: "get_" and "set_" prefixed methods are deprecated and will be removed in a future release. Take also a look in the examples folder. @@ -233,7 +237,7 @@ print(f"I2C devices found: {devices}") i2c.writeto(0x42, b'\x00\x01') # Write to another device # Camera sensor communication works too -cam.set_saturation(1) # Uses the shared I2C bus +cam.saturation = 1 # Uses the shared I2C bus ``` #### Alternative: Camera Creates Its Own I2C (Default) @@ -328,6 +332,7 @@ Example for Xiao sense: #define MICROPY_CAMERA_GRAB_MODE (1) // 0=WHEN_EMPTY (might have old data, but less resources), 1=LATEST (best, but more resources) ``` + #### Customize additional camera settings If you want to customize additional camera setting or reduce the firmware size by removing support for unused camera sensors, then take a look at the kconfig file of the esp32-camera driver and specify these on the sdkconfig file of your board. @@ -381,6 +386,7 @@ Using fb_count=2 theoretically can double the FPS (see JPEG with fb_count=2). Th ## Troubleshooting You can find information on the following sites: + - [ESP-FAQ](https://docs.espressif.com/projects/esp-faq/en/latest/application-solution/camera-application.html) - [ChatGPT](https://chatgpt.com/) - [Issues in here](https://github.com/cnadler86/micropython-camera-API/issues?q=is%3Aissue) diff --git a/esp32-camera b/esp32-camera index b9c5c51..32a7654 160000 --- a/esp32-camera +++ b/esp32-camera @@ -1 +1 @@ -Subproject commit b9c5c51c48e1f67be3a85ee1dcf7c274abb67e0b +Subproject commit 32a7654a2477a0ce56bbae50a5548ebe48e22f71 diff --git a/examples/CameraSettings.html b/examples/CameraSettings.html index e392005..0ec48bf 100644 --- a/examples/CameraSettings.html +++ b/examples/CameraSettings.html @@ -3,32 +3,50 @@