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:
41:7b21c5e3599e
Parent:
40:be98219930e4
Child:
42:c4e1606087ff
--- a/Hardwares/ArduCAM.cpp	Wed Mar 22 23:43:24 2017 +0000
+++ b/Hardwares/ArduCAM.cpp	Thu Mar 23 23:17:51 2017 +0000
@@ -6,11 +6,13 @@
 
 #include "CamRegBuf.h"
 
+#include "ArduUTFT.h"
+
 #include <string>
 
 extern SPI g_spi_port;
 
-DigitalOut cam_cs(PIN_ACC_CS);
+DigitalOut cam_cs(PIN_ACC_CS, 1);
 
 
 inline void ardu_cam_spi_write_8(int address, int value)
@@ -176,8 +178,22 @@
 #endif
     
     //ardu_cam_spi_set_burst();
+
     ardu_cam_get_pixel(); //Get the first dummy pixel
-    
+    //ardu_utft_set_xy(0, 0, 319, 239);
+    for (uint8_t i = 0; i < RESOLUTION_HEIGHT; ++i)
+    {
+        ardu_utft_set_xy(0, i + 20, 319 - 80, 239);
+        for (int j = 0; j < RESOLUTION_WIDTH; ++j)
+        {
+            uint8_t VH = ardu_cam_spi_read_8(SINGLE_FIFO_READ);
+            uint8_t VL = ardu_cam_spi_read_8(SINGLE_FIFO_READ);
+            
+            ardu_utft_write_DATA(VH, VL);
+        }
+    }
+
+/*
     for (uint8_t i = 0; i < RESOLUTION_HEIGHT; ++i)
     {
 #if defined(MANUAL_REDUCE_RESULOTION_BY2)
@@ -221,5 +237,5 @@
 #endif
         
     }
-    
+*/
 }
\ No newline at end of file