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:
34:f79db3bc2f86
Child:
44:15de535c4005
--- a/Hardwares/OV2640RegProg.h	Mon Mar 13 02:43:53 2017 +0000
+++ b/Hardwares/OV2640RegProg.h	Tue Mar 14 22:23:15 2017 +0000
@@ -4,18 +4,27 @@
 
 #include "CamRegDefinitions.h"
 
-#define OV2640_WRITE      0x60
-#define OV2640_READ       0x61
+#if defined(ARDUCAM_OV2640)
+
+#define CAM_SCCB_WRITE      0x60
+#define CAM_SCCB_READ       0x61
 
-#define OV2640_PID_VALUE        0x26
-#define OV2640_VER_VALUE        0x42
+#define CAM_PID_VALUE        0x26
+#define CAM_VER_VALUE        0x42
 
-#define OV2640_PID_ADDR      0x0A
-#define OV2640_VER_ADDR      0x0B
+#define CAM_PID_ADDR      0x0A
+#define CAM_VER_ADDR      0x0B
 
 namespace OV2640Prog
 {
     
+const struct sensor_reg ResetProg[]  =
+{
+    {0xff, 0x01},
+    {0x12, 0x80},
+    {0xff, 0xff},
+};
+
 #if (defined(RESOLUTION_WIDTH) && RESOLUTION_WIDTH == 800) && (defined(RESOLUTION_HEIGHT) && RESOLUTION_HEIGHT == 600)
 const struct sensor_reg SVGA[]  =
 {
@@ -416,12 +425,13 @@
     {0x5a, 0x50},  //Zoom
     {0x5b, 0x3C},  //Zoom
     {0x5c, 0x00},  //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)
     {0x5a, 0x28},  //Zoom
     {0x5b, 0x1E},  //Zoom
     {0x5c, 0x00},  //Zoom
+    
+#else
+    #error Must pick one valid resolution!!
 #endif
     
     {0xd3, 0x04}, 
@@ -988,4 +998,6 @@
 #endif //CAMERA_JPEG_FORMAT
 }
 
+#endif //ARDUCAM_OV2640
+
 #endif //OV2640_REG_PROG_H
\ No newline at end of file