Ableson
发表于: 2020-4-15 17:58:15 | 显示全部楼层

上面的代码不全, 补上
  1. if(SD_ReadDisk(lcd_send_buf1,240*(PIC_TOTAL+10),1)==0)
  2. {
  3. sd_select=lcd_send_buf1[0];
  4. if(sd_select>=PIC_TOTAL )
  5. {
  6. lcd_send_buf1[0]=0x00;
  7. SD_WriteDisk(lcd_send_buf1,240*(PIC_TOTAL+10),1);
  8. sd_select=0;
  9. }
  10. }
  11. //show_sdcard_info();         
  12. EXTI8_Init();       
  13. OV7670_CS=0;       

  14. config_ov7670_OutPut(20,60,user_width,user_heigh,0);
  15. while(1)
  16. {
  17. if(USART_RX_END==1)
  18. {
  19. switch(USART_RX_BUF[5])
  20. {
  21. case 0x2c:
  22. clear_display();
  23. pixel_ch_flag+=1;//!pixel_ch_flag;
  24. if(pixel_ch_flag>3)
  25. pixel_ch_flag=0;
  26. if(pixel_ch_flag==1)
  27. {
  28. user_width=160;
  29. user_heigh=160;
  30. }
  31. else if(pixel_ch_flag==2)
  32. {
  33. user_width=80;
  34. user_heigh=80;       
  35. }
  36. else if(pixel_ch_flag==3)
  37. {
  38. user_width=320;
  39. user_heigh=240;
  40. }
  41. else
  42. {
  43. user_width=240;
  44. user_heigh=240;
  45. }

  46. config_ov7670_OutPut(20,60,user_width,user_heigh,0);
  47. if(user_effect_flag)
  48. OV7670_Special_Effects(1);
  49. else
  50. OV7670_Special_Effects(0);
  51. break;

  52. case 0x2b:
  53. user_effect_flag=!user_effect_flag;
  54. if(user_effect_flag)
  55. OV7670_Special_Effects(1);
  56. else
  57. OV7670_Special_Effects(0);
  58. break;

  59. case 0x2a:
  60. if(user_width!=240)break;

  61. if(img_dis_cnt==0)
  62. {
  63. img_dis_cnt=1;
  64. }
  65. else
  66. {
  67. if(SD_ReadDisk(lcd_send_buf1,240*(PIC_TOTAL+10),1)==0)
  68. {
  69. if(lcd_send_buf1[0]>=PIC_TOTAL)
  70. {
  71. lcd_send_buf1[0]=PIC_TOTAL;
  72. sd_select=1;
  73. }
  74. else
  75. {
  76. sd_select=lcd_send_buf1[0]+1;
  77. lcd_send_buf1[0]=sd_select;
  78. }
  79. SD_WriteDisk(lcd_send_buf1,240*(PIC_TOTAL+10),1);
  80. user_save_image();
  81. //sd_select=lcd_send_buf1[0];
  82. }
  83. }
  84. break;
  85. case 0x2d:
  86. if(SD_ReadDisk(lcd_send_buf1,240*(PIC_TOTAL+10),1)==0)
  87. {
  88. if(lcd_send_buf1[0]==0)
  89. break;
  90. else
  91. {
  92. sd_select-=1;
  93. if(sd_select==0)sd_select=lcd_send_buf1[0];
  94. }
  95. if(sd_select>lcd_send_buf1[0])
  96. sd_select=1;
  97. }
  98. if(user_width==320)
  99. clear_display();
  100. read_image();
  101. img_dis_cnt=0;
  102. break;

  103. case 0x2e:
  104. if(SD_ReadDisk(lcd_send_buf1,240*(PIC_TOTAL+10),1)==0)
  105. {
  106. if(lcd_send_buf1[0]==0)
  107. break;
  108. if(sd_select>=lcd_send_buf1[0])
  109. {
  110. sd_select=1;
  111. }
  112. else
  113. {
  114. sd_select+=1;
  115. }
  116. }
  117. if(user_width==320)
  118. clear_display();
  119. read_image();
  120. img_dis_cnt=0;
  121. break;
  122. case 0x2f:
  123. img_dis_cnt=0;
  124. break;
  125. default:
  126. break;
  127. }
  128. USART_RX_END=0;
  129. USART_RX_STA=0;
  130. }
  131. else
  132. {
  133. //        USART_RX_END=0;
  134. //        USART_RX_STA=0;
  135. if(img_dis_cnt==1)
  136. camera_refresh();
  137. }
  138. }
  139. }
复制代码
回复

使用道具 举报

Ableson
发表于: 2020-4-15 17:59:06 | 显示全部楼层

最后把代码下载到STM32芯片中,然后把做好的电路板和显示屏连接,并且保证供电稳定,就可以通过STONE显示模组看到VO7670拍摄到的图片了。

运行效果图


回复

使用道具 举报

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

本版积分规则

主题 11 | 回复: 23



手机版|

GMT+8, 2024-11-15 07:21 , Processed in 0.042602 second(s), 7 queries , Gzip On, MemCache On. Powered by Discuz! X3.5

YiBoard一板网 © 2015-2022 地址:河北省石家庄市长安区高营大街 ( 冀ICP备18020117号 )

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