极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 33447|回复: 14

关于arduino OV7670撷取图片

[复制链接]
发表于 2012-10-13 14:07:25 | 显示全部楼层 |阅读模式
本帖最后由 peter11016 于 2012-10-13 14:09 编辑

目前是要用摄像头采集数据。
Arduino mega2560和OV7670摄像头模組
但是没有丝毫头绪啊。
网上也找不到相关教程……


我是想要用SCCB来撷取图片暂存就好了
买的时候有附代码,可是是AVR的
所以不知道有大大可以教导一下如何使用吗

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复

使用道具 举报

发表于 2012-10-13 22:21:09 | 显示全部楼层
弘毅版主来解决吧,俺也期待
回复 支持 反对

使用道具 举报

发表于 2012-10-14 13:08:50 | 显示全部楼层
我也在研究这一块,我目前打算做一个web server +摄像头,用MEGA 2560,不过是VC0706的例子,目前我收集到这么一个网页,上面就有这么一个移动侦测的例子:
https://github.com/adafruit/Adafruit-VC0706-Serial-Camera-Library
点examples里面就有移动侦测的例子,库文件也都在,不过目前没有尝试过,原技术讨论地址:http://arduino.cc/forum/index.php/topic,115501.msg869131.html#msg869131
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-10-15 23:31:19 | 显示全部楼层
N176CM 发表于 2012-10-14 13:08
我也在研究这一块,我目前打算做一个web server +摄像头,用MEGA 2560,不过是VC0706的例子,目前我收集到这 ...

感谢您
不过我有试过了这VC0706跟OV7670晶片使用不同
试过了没办法

感谢您的回答
回复 支持 反对

使用道具 举报

发表于 2012-10-16 11:58:51 | 显示全部楼层
我也在用ov7670
回复 支持 反对

使用道具 举报

发表于 2012-10-16 12:02:57 | 显示全部楼层
不过 avr 的  等我改天把它改成arduino的再发出来共享。这两天没时间。 模块倒是买了很久了
回复 支持 反对

使用道具 举报

发表于 2012-10-16 12:30:50 | 显示全部楼层
其实只要把相对应的命令改改就可以了。 vc7060里面的 .h文件
或者你把avr ov7670的代码发上来。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-10-16 14:53:56 | 显示全部楼层
有阿在夾帶檔裡
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-10-16 14:55:09 | 显示全部楼层
还是要贴在回文中
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-10-16 14:59:38 | 显示全部楼层
Pizzro 发表于 2012-10-16 12:30
其实只要把相对应的命令改改就可以了。 vc7060里面的 .h文件
或者你把avr ov7670的代码发上来。
  1. Adafruit_VC0706.h


  2. /***************************************************
  3.   This is a library for the Adafruit TTL JPEG Camera (VC0706 chipset)

  4.   Pick one up today in the adafruit shop!
  5.   ------> http://www.adafruit.com/products/397

  6.   These displays use Serial to communicate, 2 pins are required to interface

  7.   Adafruit invests time and resources providing this open source code,
  8.   please support Adafruit and open-source hardware by purchasing
  9.   products from Adafruit!

  10.   Written by Limor Fried/Ladyada for Adafruit Industries.  
  11.   BSD license, all text above must be included in any redistribution
  12. ****************************************************/


  13. #if ARDUINO >= 100
  14. #include "Arduino.h"
  15. #include "SoftwareSerial.h"
  16. #else
  17. #include "WProgram.h"
  18. #include "NewSoftSerial.h"
  19. #endif

  20. #define VC0706_RESET  0x26
  21. #define VC0706_GEN_VERSION 0x11
  22. #define VC0706_READ_FBUF 0x32
  23. #define VC0706_GET_FBUF_LEN 0x34
  24. #define VC0706_FBUF_CTRL 0x36
  25. #define VC0706_DOWNSIZE_CTRL 0x54
  26. #define VC0706_DOWNSIZE_STATUS 0x55
  27. #define VC0706_READ_DATA 0x30
  28. #define VC0706_WRITE_DATA 0x31
  29. #define VC0706_COMM_MOTION_CTRL 0x37
  30. #define VC0706_COMM_MOTION_STATUS 0x38
  31. #define VC0706_COMM_MOTION_DETECTED 0x39
  32. #define VC0706_MOTION_CTRL 0x42
  33. #define VC0706_MOTION_STATUS 0x43
  34. #define VC0706_TVOUT_CTRL 0x44
  35. #define VC0706_OSD_ADD_CHAR 0x45

  36. #define VC0706_STOPCURRENTFRAME 0x0
  37. #define VC0706_STOPNEXTFRAME 0x1
  38. #define VC0706_RESUMEFRAME 0x3
  39. #define VC0706_STEPFRAME 0x2

  40. #define VC0706_640x480 0x00
  41. #define VC0706_320x240 0x11
  42. #define VC0706_160x120 0x22

  43. #define VC0706_MOTIONCONTROL 0x0
  44. #define VC0706_UARTMOTION 0x01
  45. #define VC0706_ACTIVATEMOTION 0x01

  46. #define VC0706_SET_ZOOM 0x52
  47. #define VC0706_GET_ZOOM 0x53

  48. #define CAMERABUFFSIZ 100
  49. #define CAMERADELAY 10


  50. class Adafruit_VC0706 {
  51. public:
  52. #if ARDUINO >= 100
  53.   Adafruit_VC0706(SoftwareSerial *ser); // Constructor when using SoftwareSerial
  54. #else
  55.   Adafruit_VC0706(NewSoftSerial  *ser); // Constructor when using NewSoftSerial
  56. #endif
  57.   Adafruit_VC0706(HardwareSerial *ser); // Constructor when using HardwareSerial
  58.   boolean begin(uint16_t baud = 38400);
  59.   boolean reset(void);
  60.   boolean TVon(void);
  61.   boolean TVoff(void);
  62.   boolean takePicture(void);
  63.   uint8_t *readPicture(uint8_t n);
  64.   boolean resumeVideo(void);
  65.   uint32_t frameLength(void);
  66.   char *getVersion(void);
  67.   uint8_t available();
  68.   uint8_t getDownsize(void);
  69.   boolean setDownsize(uint8_t);
  70.   uint8_t getImageSize();
  71.   boolean setImageSize(uint8_t);
  72.   boolean getMotionDetect();
  73.   uint8_t getMotionStatus(uint8_t);
  74.   boolean motionDetected();
  75.   boolean setMotionDetect(boolean f);
  76.   boolean setMotionStatus(uint8_t x, uint8_t d1, uint8_t d2);
  77.   boolean cameraFrameBuffCtrl(uint8_t command);
  78.   uint8_t getCompression();
  79.   boolean setCompression(uint8_t c);
  80.   
  81.   boolean getPTZ(uint16_t &w, uint16_t &h, uint16_t &wz, uint16_t &hz, uint16_t &pan, uint16_t &tilt);
  82.   boolean setPTZ(uint16_t wz, uint16_t hz, uint16_t pan, uint16_t tilt);

  83.   void OSD(uint8_t x, uint8_t y, char *s); // isnt supported by the chip :(
  84.   
  85. private:
  86.   uint8_t  serialNum;
  87.   uint8_t  camerabuff[CAMERABUFFSIZ+1];
  88.   uint8_t  bufferLen;
  89.   uint16_t frameptr;
  90. #if ARDUINO >= 100
  91.   SoftwareSerial *swSerial;
  92. #else
  93.   NewSoftSerial  *swSerial;
  94. #endif
  95.   HardwareSerial *hwSerial;

  96.   void common_init(void);
  97.   boolean runCommand(uint8_t cmd, uint8_t args[], uint8_t argn, uint8_t resp, boolean flushflag = true);
  98.   void sendCommand(uint8_t cmd, uint8_t args[], uint8_t argn);
  99.   uint8_t readResponse(uint8_t numbytes, uint8_t timeout);
  100.   boolean verifyResponse(uint8_t command);
  101.   void printBuff(void);
  102. };
复制代码
回复 支持 反对

使用道具 举报

发表于 2012-11-5 17:37:06 | 显示全部楼层
我最近实在没有时间。 想弄。 建议你去 github.com 上面去搜索一下 看有现成的 7670的不
回复 支持 反对

使用道具 举报

发表于 2015-3-23 15:52:23 | 显示全部楼层
可以进行视频的采集是吗
回复 支持 反对

使用道具 举报

发表于 2015-4-1 10:53:52 | 显示全部楼层
我也在做,不知道你做出来了吗?
回复 支持 反对

使用道具 举报

发表于 2015-4-1 11:30:26 | 显示全部楼层
楼主,你这个压缩文件怎么用?不明白
回复 支持 反对

使用道具 举报

发表于 2015-9-22 21:37:37 | 显示全部楼层
我在用VC0706
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|联系我们|极客工坊

GMT+8, 2026-6-8 01:29 , Processed in 0.067236 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表