Go to file
Jeff Epler 5db6db0128
add esp32-camera
This uses the esp32-camera code instead of our own homebrewed camera code.
In theory it supports esp32, esp32-s2 and esp32-s3, as long as they have
PSRAM.

This is very basic and doesn't support changing any camera parameters,
including switching resolution or pixelformat.

This is tested on the Kaluga (ESP32-S2) and ESP32-S3-Eye boards.

First, reserve some PSRAM by putting this line in `CIRCUITPY/_env`:
```
CIRCUITPY_RESERVED_PSRAM=524288
```
and hard-reset the board for it to take effect.

Now, the following script will take a very low-resolution jpeg file and print
it in the REPL in escape coded form:

```python
import board
import esp32_camera

c = esp32_camera.Camera(
    data_pins=board.CAMERA_DATA,
    external_clock_pin=board.CAMERA_XCLK,
    pixel_clock_pin=board.CAMERA_PCLK,
    vsync_pin=board.CAMERA_VSYNC,
    href_pin=board.CAMERA_HREF,
    pixel_format=esp32_camera.PixelFormat.JPEG,
    i2c=board.I2C(),
    external_clock_frequency=20_000_000)

m = c.take()
if m is not None:
    print(bytes(m))
```

Then on desktop open a python repl and run something like
```python
>>> with open("my.jpg", "wb") as f: f.write(<BIG PASTE FROM REPL>)
```
and open my.jpg in a viewer.
2022-08-04 15:11:50 -05:00
.github fix name for macOS mpy-cross universal build 2022-07-28 18:14:32 -04:00
LICENSES Add an explicit SPDX license file for ter-u12n. 2020-07-06 19:15:41 +01:00
data ESP32 .bin only; update nvm.toml 2022-07-08 20:37:47 -04:00
devices/ble_hci Retrieve the BLE name from dotenv if available 2022-07-14 11:55:53 +02:00
docs Add ability to reserve psram 2022-08-03 16:19:40 -05:00
examples Fix all natmod tests to run on x64 2022-02-13 11:18:38 -06:00
extmod Pull in a fix for ulab on REPR_A builds (some broadcom builds) 2022-07-07 17:16:48 -05:00
frozen Merge pull request #6648 from pypewpew/stage-png 2022-07-27 11:02:48 -07:00
lib Merge pull request #5852 from jepler/floppy 2022-04-26 11:40:19 -04:00
locale Add ability to reserve psram 2022-08-03 16:19:40 -05:00
logo Add license to some obvious files. 2020-07-06 19:16:25 +01:00
mpy-cross don't specify -sdk in Makefile.m1 for mpy-cross 2022-07-27 22:51:14 -04:00
ports add esp32-camera 2022-08-04 15:11:50 -05:00
py add esp32-camera 2022-08-04 15:11:50 -05:00
shared Update shared/readline/readline.c 2022-07-26 11:39:18 -05:00
shared-bindings Fix typo 2022-08-04 15:11:49 -05:00
shared-module Add ability to reserve psram 2022-08-03 16:19:40 -05:00
supervisor Add ability to reserve psram 2022-08-03 16:19:40 -05:00
tests update expected results of help(modules) 2022-07-07 13:42:03 -05:00
tools Merge branch 'main' into webflow_edit_page 2022-07-29 10:03:07 -07:00
.git-blame-ignore-revs top: Update .git-blame-ignore-revs for latest formatting commit. 2021-04-27 23:46:46 +10:00
.gitattributes Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
.gitignore refine stubs-building procedure 2021-06-22 08:59:05 -05:00
.gitmodules add esp32-camera 2022-08-04 15:11:50 -05:00
.mailmap Add a `.mailmap` file to collate together multiple author entries. 2020-07-06 19:15:41 +01:00
.pre-commit-config.yaml Add neopixel support on PWM capable pins 2021-12-14 16:59:53 -08:00
.readthedocs.yml Fetch the submodules in readthedocs with ci_fetch_deps.py 2022-05-14 23:17:49 +02:00
.rosie.yml Add license to some obvious files. 2020-07-06 19:16:25 +01:00
ACKNOWLEDGEMENTS Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
ACKNOWLEDGEMENTS.license Add license to some obvious files. 2020-07-06 19:16:25 +01:00
BUILDING.md Correct typo 2022-07-05 12:03:04 -04:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md from source-of-truth repository. 2020-06-03 10:43:36 +01:00
CONTRIBUTING.md Fix error 2020-10-26 23:36:54 +01:00
LICENSE LICENSE,docs: Update copyright year range to include 2022. 2022-01-06 15:50:14 +11:00
MANIFEST.in-stubs refine stubs-building procedure 2021-06-22 08:59:05 -05:00
Makefile Add fetch-modules to `make help` for main makefile 2022-05-11 23:45:37 -04:00
README.rst link to workflow page in docs. Capitalize "Workflow" 2022-07-01 13:57:32 -05:00
README.rst-stubs Actually reduce the README text for the stubs package 2021-06-24 13:41:01 -05:00
WEBUSB_README.md Rename esp32s2 port to espressif 2021-09-13 16:44:55 -07:00
conf.py list extensions instead of macros names ("bin,uf2" not BIN_UF2) 2022-07-26 18:15:59 +02:00
license.rst Improve docs and update to CircuitPython. 2017-01-05 16:20:46 -08:00
main.c Add ability to reserve psram 2022-08-03 16:19:40 -05:00
requirements-ci.txt build docs dynamically 2021-09-16 00:05:42 +05:30
requirements-dev.txt Update requirements-dev.txt 2022-07-27 18:28:01 +01:00
requirements-doc.txt add adafruit-circuitpython-typing to requirements-doc.txt 2022-02-27 00:06:40 -05:00
runtime.py Conditionalize LTO 2022-05-27 12:59:54 -07:00
setup.py-stubs use --long for describe in setup.py-stubs 2022-02-18 21:22:02 -05:00

README.rst-stubs

CircuitPython
=============

.. image:: https://s3.amazonaws.com/adafruit-circuit-python/CircuitPython_Repo_header_logo.png

|Build Status| |Doc Status| |License| |Discord| |Weblate|

`circuitpython.org <https://circuitpython.org>`__ \| `Get CircuitPython <#get-circuitpython>`__ \|
`Documentation <#documentation>`__ \| `Contributing <#contributing>`__ \|
`Branding <#branding>`__ \| `Differences from Micropython <#differences-from-micropython>`__ \|
`Project Structure <#project-structure>`__

**CircuitPython** is a *beginner friendly*, open source version of Python for tiny, inexpensive
computers called microcontrollers.

This package contains the "stubs", or type definitions for CircuitPython.  With some advanced
editors and other tools, this information can be identify TypeErrors, AttributeErrors, and other
problems before you deploy your code to a device and can even help autocomplete your code.

.. |Build Status| image:: https://github.com/adafruit/circuitpython/workflows/Build%20CI/badge.svg
   :target: https://github.com/adafruit/circuitpython/actions?query=branch%3Amain
.. |Doc Status| image:: https://readthedocs.org/projects/circuitpython/badge/?version=latest
   :target: http://circuitpython.readthedocs.io/
.. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg
   :target: https://adafru.it/discord
.. |License| image:: https://img.shields.io/badge/License-MIT-brightgreen.svg
   :target: https://choosealicense.com/licenses/mit/
.. |Weblate| image:: https://hosted.weblate.org/widgets/circuitpython/-/svg-badge.svg
   :target: https://hosted.weblate.org/engage/circuitpython/?utm_source=widget