新手入门
- 积分
- 12
- 金钱
- 12
- 注册时间
- 2017-10-26
- 在线时间
- 5 小时
|

楼主 |
发表于 2017-11-18 14:40:25
|
显示全部楼层
void camera_refresh(void)
{
u16 color,judge=0;
u8 YUV_U;
if(ov_sta)//óDÖ¡ÖD¶Ï¸üD£¿
{
uint32_t cnt =2,i;
OV7670_RRST=0; //¿a꼸′λ¶áÖ¸Õë
OV7670_RCK_L;
OV7670_RCK_H;
OV7670_RCK_L;
OV7670_RRST=1;
OV7670_RCK_H;
for(col=0;col<240;col++)
{
for(row=0;row<320;row++)
{
OV7670_RCK_L;
color=OV7670_DATA; //¶áêy¾Y
OV7670_RCK_H;
OV7670_RCK_L;
YUV_U=OV7670_DATA; //¶áêy¾Y
OV7670_RCK_H;
if(background==1&&(col%2==0)&&(row%2==0))
{
SendBuff[cnt++] = (u8)color;
}else if (background==0&&(col%2==0)&&(row%2==0))
{
SendBuff3[cnt++] = (u8)color;
}
}
}
for( i=2;i<SEND_BUF_SIZE;i++){
if(SendBuff[i]!=SendBuff3[i]){
judge++;
}
}
if(judge>=10000){
LED1=0;
}else {
LED1=1;
}
background=0;
ov_sta=0; //ÇåáãÖ¡ÖD¶Ï±ê¼Ç
ov_frame++;
}
}
|
|