OV2640 相机的 micropython 驱动

MicroPython相关代码、库、软件、工具
回复
头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

OV2640 相机的 micropython 驱动

#1

帖子 shaoziyang »

ESP8266 和 ESP32 的 MicroPython ArduCAM OV2640 基本接口。

引脚

将相机连接到 ESP8266 和 ESP32 的方法如下
相机引脚  ESP8266 引脚  ESP32 引脚  
CS        GPIO2        GPIO15      
MOSI      GPIO13        GPIO13      
MISO        GPIO12        GPIO12      
SCK     GPIO14        GPIO14      
SDA     GPIO4        GPIO21      
SCL      GPIO5        GPIO22      
隐藏内容
你必须登入/注册才可观看隐藏内容
 

头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

Re: OV2640 相机的 micropython 驱动

#2

帖子 shaoziyang »

代码: 全选

import ov2640
import gc
import time
import sys

FNAME = 'image2.jpg'

def main():
    try:
        print("initializing camera")
        cam = ov2640.ov2640(resolution=ov2640.OV2640_320x240_JPEG)
        #cam = ov2640.ov2640(resolution=ov2640.OV2640_1024x768_JPEG)
        print(gc.mem_free())
    
        clen = cam.capture_to_file(FNAME, True)
        print("captured image is %d bytes" % clen)
        print("image is saved to %s" % FNAME)
    
        time.sleep(10)
        sys.exit(0)
    
    except KeyboardInterrupt:
        print("exiting...")
        sys.exit(0)


if __name__ == '__main__':
    main()
 

回复

  • 随机主题
    回复总数
    阅读次数
    最新文章