PZ-OV7670摄像头模块

  • v7_287191
    了解作者
  • 11MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-18 05:07
    上传日期
STM32摄像头模块成像 #include "system.h" #include "SysTick.h" #include "led.h" #include "usart.h" #include "tftlcd.h" #include "key.h" #include "malloc.h" #include "sd.h" #include "flash.h" #include "ff.h" #include "fatfs_app.h" #include "key.h" #include "font_show.h" #include "exti.h" #include "time.h" #include "string.h" #include "math.h" #include "ov7670.h" extern u8 ov_sta; //在exit.c里面定义 extern u8 ov_frame; //在time.c里面定义 //更新LCD显示 void camera_refresh(void) { u32 j; u16 i; u16 color; u16 temp; if(ov_sta)//有帧中断更新? { //LCD_Set_Window((tftlcd_data.width-320)/2,(tftlcd_data.height-240)/2,320,240-1);//将显示区域设置到屏幕中央 LCD_Set_Window(0,(tftlcd_data.height-240)/2,320-1,240-1);//将显示区域设置到屏幕中央 OV7670_RRST=0; //开始复位读指针 OV7670_RCK_L; OV7670_RCK_H; OV7670_RCK_L; OV7670_RRST=1; //复位读指针结束 OV7670_RCK_H; /*for(i=0;i<240;i++) //此种方式可以兼容任何彩屏,但是速度很慢 { for(j=0;j<320;j++) { OV7670_RCK_L; color=GPIOF->IDR&0XFF; //读数据 OV7670_RCK_H; color<<=8; OV7670_RCK_L; color|=GPIOF->IDR&0XFF; //读数据 OV7670_RCK_H; LCD_DrawFRONT_COLOR(j,i,color); } }*/ for(j=0;j<76800;j++) //此种方式需清楚TFT内部显示方向控制寄存器值 速度较快 { OV7670_RCK_L; color=GPIOF->IDR&0XFF; //读数据 OV7670_RCK_H; color<<=8; OV7670_RCK_L; color|=GPIOF->IDR&0XFF; //读数据 OV7670_RCK_H; LCD_WriteData_Color(color); //printf("%x ",color); //if(j ==0)printf("\r\n"); //delay_us(50); } ov_sta=0; //清零帧中断标记 ov_frame++; } } const u8*LMODE_TBL[5]={"Auto","Sunny","Cloudy","Office","Home"}; const u8*EFFECTS_TBL[7]={"Normal","Negative","B&W","Redish","Greenish","Bluish","Antique"}; //7种特效 int main() { u8 i=0; u8 key; u8 lightmode=0,saturation=2,brightness=2,contrast=2; u8 effect=0; u8 sbuf[15]; u8 count; SysTick_Init(72); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //中断优先级分组 分2组 LED_Init(); USART1_Init(9600); TFTLCD_Init(); //LCD初始化 KEY_Init(); EN25QXX_Init(); //初始化EN25Q128 my_mem_init(SRAMIN); //初始化内部内存池 FRONT_COLOR=RED;//设置字体为红色 // while(SD_Init()!=0) // { // LCD_ShowString(10,10,tftlcd_data.width,tftlcd_data.height,16,"SD Card Error!"); // } // FATFS_Init(); //为fatfs相关变量申请内存 // f_mount(fs[0],"0:",1); //挂载SD卡 // f_mount(fs[1],"1:",1); //挂载FLASH. LCD_ShowFont12Char(10, 10, "普中科技"); LCD_ShowFont12Char(10, 30, "www.prechin.net"); LCD_ShowFont12Char(10, 50, "摄像头应用--OV7670"); i=OV7670_Init(); printf("i=%d\n",i); while(OV7670_Init())//初始化OV7670 { LCD_ShowString(10,80,tftlcd_data.width,tftlcd_data.height,16,"OV7670 Error!"); delay_ms(200); LCD_Fill(10,80,239,206,WHITE); delay_ms(200); } LCD_ShowString(10,80,tftlcd_data.width,tftlcd_data.height,16,"OV7670 OK! "); delay_ms(1500); OV7670_Light_Mode(0); OV7670_Color_Saturation(2); OV7670_Brightness(2); OV7670_Contrast(2); OV7670_Special_Effects(0); TIM4_Init(10000,7199); //10Khz计数频率,1秒钟中断 EXTI7_Init(); OV7670_Window_Set(12,176,240,320); //设置窗口 OV7670_CS=0; LCD_Clear(BLACK); while(1) { key=KEY_Scan(0); if(key)count=20; switch(key) { case KEY_UP: //灯光模式设置 lightmode++; if(lightmode>4)lightmode=0; OV7670_Light_Mode(lightmode); sprintf((char*)sbuf,"%s",LMODE_TBL[lightmode]); break; case KEY_DOWN: //饱和度 saturation++; if(saturation>4)saturation=0; OV7670_Color_Saturation(saturation); sprintf((char*)sbuf,"Saturation:%d",(char)saturation-2); break; case KEY_LEFT: //亮度 brightness++; if(brightness>4)brightness=0; OV7670_Brightness(brightness); sprintf((char*)sbuf,"Brightness:%d",(char)brightness-2); break; case KEY_RIGHT: //对比度 contrast++; if(contrast>4)contrast=0; OV7670_Contrast(contrast); sprintf((char*)sbuf,"Contrast:%d",(char)contrast-2); break; } if(count) { count--; LCD_ShowString((tftlcd_data.width-240)/2+30,(tftlcd_data.height-320)/2+60,200,16,16,sbuf); } camera_refresh();//更新显示 i++; if(i ==0) { led1=!led1; } //delay_ms(5); } }
PZ-OV7670摄像头模块.rar
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/63832e099f0e6d0d65414a1f/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/63832e099f0e6d0d65414a1f/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">&#24320;&#28304;<span class="_ _0"></span>&#20849;&#20139;<span class="_ _1"> </span>&#25658;&#25163;<span class="_ _0"></span>&#20849;&#36827;</div><div class="t m0 x2 h2 y2 ff1 fs0 fc0 sc0 ls0 ws0">&#28145;&#22323;<span class="_ _0"></span>&#26222;&#20013;<span class="_ _0"></span>&#31185;&#25216;<span class="_ _0"></span>&#26377;&#38480;<span class="_ _0"></span>&#20844;&#21496;</div><div class="t m0 x2 h3 y3 ff1 fs1 fc0 sc1 ls0 ws0">&#23448;&#26041;&#32593;&#31449;&#65306;<span class="fc1">www.prechin.cn</span></div><div class="t m0 x2 h3 y4 ff1 fs1 fc0 sc1 ls0 ws0">&#25216;&#26415;&#35770;&#22363;&#65306;<span class="fc1">www.prechin.net</span></div><div class="t m0 x2 h3 y5 ff1 fs1 fc0 sc1 ls0 ws0">&#25216;&#26415;<span class="_ _2"> </span>QQ&#65306;2489019400</div><div class="t m0 x2 h3 y6 ff1 fs1 fc0 sc1 ls0 ws0">&#21672;&#35810;&#30005;&#35805;&#65306;0755-61139052</div><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a></div><div class="pi" data-data='{"ctm":[1.611830,0.000000,0.000000,1.611830,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐
    • Redis设计与实现(第二版)chm版.rar
      redis底层原理的设计与实现,深入理解和掌握redis
    • 最新2020版 redis-desktop-manager
      最新2020版 redis-desktop-manager
    • redisdesktopmanager_jb51.rar
      redisdesktopmanager_jb51.rar
    • flash .swf
      Get the Flash Player to see this rotator. Quickstart The easiest way to get going with the imagerotator is by copy-pasting the source code of this page to your site. Also make sure to copy-paste the ....
    • redisdesktopmanager.rar
      一款Redis可视化连接工具,非常好用
    • koa-flash-message:用于Koa的Flash消息中间件
      koa-flash消息 用于 v2应用程序的Flash消息中间件。 安装 $ npm install koa-flash-message koa-flash-message中间件取决于koa-generic-session...import koaRedis from 'koa-redis'; import flashMessage from 'koa-
    • RG100A-AA jtag 工具---linjtag 0.1.0
      1. 本软件无任何保障,使用本软件一切后果自负,不愿意自负后果者切勿使用本软件。 2. 运行前会自动安装和启动giveio。 3. 图形界面菜单操作 4.... 5.... 6.... 7....如果看不到启动giveio的提示,需要vcredist_x86来
    • RedisDesktopManager_v0.9.3.817_itmop.com(可用).zip
      之前下载的版本总是乱码,终于找到了这款,直接解压就可以用,分享给需要的人。 资源简介: ...一款非常实用的redis桌面管理工具,它可以支持命令控制台操作,以及常用,查询key,rename,delete等操作。
    • DbgFlashVul:DbgFlashVul
      美联储 DbgFlashVul Windbg的扩展,有助于调试Flash示例 您需要先安装VS2012 redist。 它是针对研究人员而非用户的工具。 可能有一些错误。 详细信息在PPT文件中。 由@heisecode撰写
    • flash:Hibernate常见
      flash ###This is a NiuBi's Supermarket gogogo!...4. flash-redis redis的工具包 5. flash-sso 单点登录 6. flash-ucenter 用户管理系统,包含权限管理 7. flash-service 业务代码,后期 会继续拆分