Version 3: Trying to interleave capture and read

Dependencies:   ov7670_lib Project_test

Committer:
sebbarpar
Date:
Mon Apr 06 11:23:49 2020 +0000
Revision:
7:9e4e66a8554e
Parent:
6:c7450b320c30
Child:
8:36adb37e976d
V3;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
edodm85 0:19429e334b75 1 /*
edodm85 0:19429e334b75 2 * Author: Edoardo De Marchi
edodm85 3:b4e0cefc37f6 3 * Date: 07/04/13
edodm85 0:19429e334b75 4 * Notes: OV7670 + FIFO AL422B camera test
edodm85 0:19429e334b75 5 */
edodm85 0:19429e334b75 6
edodm85 0:19429e334b75 7 #include "main.h"
edodm85 0:19429e334b75 8
edodm85 2:bbd557817319 9 #define VGA 307200 //640*480
edodm85 2:bbd557817319 10 #define QVGA 76800 //320*240
edodm85 2:bbd557817319 11 #define QQVGA 19200 //160*120
sebbarpar 5:4135ec0f88e6 12 //FileSystem local("local");
edodm85 2:bbd557817319 13 static char format = ' ';
edodm85 2:bbd557817319 14 static int resolution = 0;
edodm85 0:19429e334b75 15
edodm85 0:19429e334b75 16
sebbarpar 5:4135ec0f88e6 17
edodm85 0:19429e334b75 18
edodm85 0:19429e334b75 19 int main()
sebbarpar 5:4135ec0f88e6 20 {
sebbarpar 5:4135ec0f88e6 21 //FILE *wrt=fopen("/local/out.txt","w");
sebbarpar 7:9e4e66a8554e 22 int pixel[QVGA];
sebbarpar 7:9e4e66a8554e 23 int pixel2[QVGA];
sebbarpar 7:9e4e66a8554e 24 camera.Init('y', QVGA);
sebbarpar 7:9e4e66a8554e 25 pc.printf("\r\nCamera initiated");
sebbarpar 6:c7450b320c30 26 camera.CaptureNext();
sebbarpar 6:c7450b320c30 27 while(camera.CaptureDone() == false);
sebbarpar 5:4135ec0f88e6 28 camera.ReadStart();
sebbarpar 5:4135ec0f88e6 29 t1 = t.read_ms();
sebbarpar 5:4135ec0f88e6 30 t.start();
sebbarpar 7:9e4e66a8554e 31 for(int x = 0; x<QVGA; x++)
sebbarpar 5:4135ec0f88e6 32 {
sebbarpar 5:4135ec0f88e6 33 pixel[x]=camera.ReadOnebyte();
sebbarpar 5:4135ec0f88e6 34 //fprintf(fp,"%i", pixel[x]);
sebbarpar 5:4135ec0f88e6 35 //pixel2[x]=camera.ReadOnebyte();
sebbarpar 5:4135ec0f88e6 36 //fprintf(fp,"%i/n", pixel2[x]);
sebbarpar 7:9e4e66a8554e 37 pc.printf("%d ", camera.ReadOnebyte());
sebbarpar 5:4135ec0f88e6 38 }
sebbarpar 5:4135ec0f88e6 39
sebbarpar 5:4135ec0f88e6 40 camera.ReadStop();
sebbarpar 5:4135ec0f88e6 41 pc.printf("done in %f\r\n",t.read());
sebbarpar 5:4135ec0f88e6 42 //fclose(fp);
sebbarpar 7:9e4e66a8554e 43
edodm85 2:bbd557817319 44 }