SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

Revision:
36:7e747e19f660
Parent:
35:ac4fcca21560
Child:
46:a5eb9bd3bb55
--- a/Hardwares/OV7725RegProg.h	Mon Mar 13 02:43:53 2017 +0000
+++ b/Hardwares/OV7725RegProg.h	Tue Mar 14 22:23:15 2017 +0000
@@ -4,18 +4,26 @@
 
 #include "CamRegDefinitions.h"
 
-#define OV7725_WRITE      0x42
-#define OV7725_READ       0x43
+#if defined(ARDUCAM_OV7725)
+
+#define CAM_SCCB_WRITE      0x42
+#define CAM_SCCB_READ       0x43
 
-#define OV7725_PID_VALUE        0x77
-#define OV7725_VER_VALUE        0x21
+#define CAM_PID_VALUE        0x77
+#define CAM_VER_VALUE        0x21
 
-#define OV7725_PID_ADDR      0x0A
-#define OV7725_VER_ADDR      0x0B
+#define CAM_PID_ADDR      0x0A
+#define CAM_VER_ADDR      0x0B
 
 namespace OV7725Prog
 {
 
+const struct sensor_reg ResetProg[]  =
+{
+    {0x12, 0x80},
+    {0xff, 0xff},
+};
+
 //#if (defined(RESOLUTION_WIDTH) && RESOLUTION_WIDTH == 320) && (defined(RESOLUTION_HEIGHT) && RESOLUTION_HEIGHT == 240)
 const struct sensor_reg QVGA[]  =
 {
@@ -105,11 +113,12 @@
 #if (defined(RESOLUTION_WIDTH) && RESOLUTION_WIDTH == 320) && (defined(RESOLUTION_HEIGHT) && RESOLUTION_HEIGHT == 240)
     {0x29, 0x50},  //Zoom
     {0x2C, 0x78},  //Zoom
-#endif
-
-#if (defined(RESOLUTION_WIDTH) && RESOLUTION_WIDTH == 160) && (defined(RESOLUTION_HEIGHT) && RESOLUTION_HEIGHT == 120)
+#elif (defined(RESOLUTION_WIDTH) && RESOLUTION_WIDTH == 160) && (defined(RESOLUTION_HEIGHT) && RESOLUTION_HEIGHT == 120)
     {0x29, 0x28},  //Zoom
     {0x2C, 0x3C},  //Zoom
+    
+#else
+    #error Must pick one valid resolution!!
 #endif
 //    {0x29,0x50},
 //    {0x2C,0x78},
@@ -124,4 +133,6 @@
 
 
 
+#endif //ARDUCAM_OV7725
+
 #endif //OV7725_REG_PROG_H
\ No newline at end of file