Page 649 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 649

unsigned  char  OV7670_init(void)
                 {

                     unsigned  char  temp;

                     unsigned    int  i=0;
                     temp=0x80;
                     if(0==OV7670_write(0x12,  temp))
                    {

                       return 0 ;
                    }
                     HAL_Delay(5);


                     for(i=0;i<166;i++)
                    {
                       if(  0==OV7670_write(change_reg[i][0],change_reg[i][1]))
                       {
                         return  0;
                       }

                    }
                    return 0x01;  //ok
                 }



                 void  take_picture()
                 {
                     unsigned  short  temp;
                     HAL_NVIC_EnableIRQ(EXTI0_IRQn);
                     while((vsync!=2);
                     vsync=0;

                     HAL_NVIC_DisableIRQ(EXTI0_IRQn);
                       RESET_RRST;
                       RESET_RCLK;
                     SET_RCLK;

                     SET_RRST;
                       RESET_RCLK;
                     SET_RCLK;
                       for(x=0;x<240;x++)




                                                         -  642  -
   644   645   646   647   648   649   650   651   652   653   654