CANSAT_CAMERA

Dependents:   CANSAT_COMBINED CANSAT_CAMERA_servo CANSAT_CAMERA2

Fork of Camera_LS_Y201 by Shinichiro Nakamura

Revision:
6:2e14476d7164
Parent:
2:b3da8bab6e99
diff -r b3da8bab6e99 -r 2e14476d7164 Camera_LS_Y201.cpp
--- a/Camera_LS_Y201.cpp	Mon Aug 10 16:34:15 2015 +0000
+++ b/Camera_LS_Y201.cpp	Wed Sep 09 16:42:16 2015 +0000
@@ -37,6 +37,27 @@
 Camera_LS_Y201::Camera_LS_Y201(PinName tx, PinName rx) : serial(tx, rx) {
     serial.baud(38400);
 }
+Camera_LS_Y201::ErrorCode Camera_LS_Y201::baud()
+{
+    
+uint8_t send[7] = {
+        0x56,
+        0x00,
+        0x24,
+        0x03,
+        0x01,
+        0x0D,
+        0xA6
+//        56 00 24 03 01 XX XX
+    };
+uint8_t recv[5];
+waitIdle();
+sendBytes(send, sizeof(send), 200 * 1000) ;
+    
+    
+recvBytes(recv, sizeof(recv), 200 * 1000) ;
+    serial.baud(115200);
+    }
 
 /**
  * Dispose.
@@ -282,6 +303,7 @@
             if (!recvBytes(body, sizeof(body), 2 * 1000 * 1000)) {
                 return RecvError;
             }
+            //printf("saved");
             siz_done += sizeof(body);
             if (func != NULL) {
                 if (siz_done > siz_total) {