Test Code for OV7670 Camera module with FIFO AL422

Dependencies:   MODSERIAL mbed ov7670

Dependents:   OV7670_Test_Code

You can find more information in this page: https://mbed.org/users/edodm85/notebook/ov7670-camera-module/

Revision:
3:b4e0cefc37f6
Parent:
2:bbd557817319
Child:
4:d0d4760d32b2
--- a/main.cpp	Sat Mar 16 13:45:09 2013 +0000
+++ b/main.cpp	Sun Apr 07 10:52:10 2013 +0000
@@ -1,6 +1,6 @@
 /*
  * Author: Edoardo De Marchi
- * Date: 10/03/13
+ * Date: 07/04/13
  * Notes: OV7670 + FIFO AL422B camera test
 */
 
@@ -54,9 +54,8 @@
                     CameraSnap();
                     memset(word, 0, sizeof(word));      
             }else
-            if(strcmp("init_bw_VGA", word) == 0)                  // Set up for 640*480 pixels YUV (Only Y)     
+            if(strcmp("init_bw_VGA", word) == 0)                    // Set up for 640*480 pixels RAW    
             {
-                    pc.printf("Initializing ov7670 - Format YUV422(Y only) & VGA Mode\r\n");
                     format = 'b';
                     resolution = VGA;
                     if(camera.Init('b', VGA) != 1)
@@ -68,7 +67,6 @@
             }else  
             if(strcmp("init_yuv_QVGA", word) == 0)                  // Set up for 320*240 pixels YUV422   
             {
-                    pc.printf("Initializing ov7670 - Format YUV422 & QVGA Mode\r\n");
                     format = 'y';
                     resolution = QVGA;
                     if(camera.Init('b', QVGA) != 1)
@@ -80,7 +78,6 @@
             }else  
             if(strcmp("init_rgb_QVGA", word) == 0)                  // Set up for 320*240 pixels RGB565   
             {
-                    pc.printf("Initializing ov7670 - Format RGB565 & QVGA Mode\r\n");
                     format = 'r';
                     resolution = QVGA;
                     if(camera.Init('r', QVGA) != 1)
@@ -92,7 +89,6 @@
             }else 
             if(strcmp("init_bw_QVGA", word) == 0)                  // Set up for 320*240 pixels YUV (Only Y)         
             {
-                    pc.printf("Initializing ov7670 - Format YUV422(Y only) & QVGA Mode\r\n");
                     format = 'b';
                     resolution = QVGA;
                     if(camera.Init('b', QVGA) != 1)
@@ -104,7 +100,6 @@
             }else  
             if(strcmp("init_yuv_QQVGA", word) == 0)                 // Set up for 160*120 pixels YUV422
             {                            
-                    pc.printf("Initializing ov7670 - Format YUV422 & QQVGA Mode\r\n");
                     format = 'y';
                     resolution = QQVGA;
                     if(camera.Init('b', QQVGA) != 1)
@@ -116,7 +111,6 @@
             }else   
             if(strcmp("init_rgb_QQVGA", word) == 0)                 // Set up for 160*120 pixels RGB565
             {                            
-                    pc.printf("Initializing ov7670 - Format RGB565 & QQVGA Mode\r\n");
                     format = 'r';
                     resolution = QQVGA;
                     if(camera.Init('r', QQVGA) != 1)
@@ -128,7 +122,6 @@
             }else
             if(strcmp("init_bw_QQVGA", word) == 0)                 // Set up for 160*120 pixels YUV (Only Y)
             {                        
-                    pc.printf("Initializing ov7670 - Format YUV422(Y only) & QQVGA Mode\r\n");
                     format = 'b';
                     resolution = QQVGA;
                     if(camera.Init('b', QQVGA) != 1)
@@ -166,7 +159,7 @@
         for(int x = 0; x<resolution; x++)
         {
                // Read in the first half of the image
-               if(format == 'b')
+               if(format == 'b' && resolution != VGA)
                {
                     camera.ReadOnebyte();
                }else