Toma de foto y descomprimir en HEX

Dependencies:   JPEGCamera SDFileSystem mbed

Fork of SaibiCansat2014 by Takashi SASAKI

Revision:
6:9824d4e2f29b
Parent:
5:8a4b2ffa8d71
Child:
7:cc8080b31ac5
--- a/main.cpp	Tue Jul 15 10:43:04 2014 +0000
+++ b/main.cpp	Thu Jul 17 23:01:41 2014 +0000
@@ -2,8 +2,9 @@
 #include "SDFileSystem.h"
 #include "BMP085.h"
 #include "ADXL345_I2C.h"
-#include "camera.h"
- 
+//#include "camera.h"
+#include "FastJpegCamera.h"
+
 SDFileSystem sd(p5, p6, p7, p8, "sd");
 
 ADXL345_I2C accelerometer(p28, p27);
@@ -19,6 +20,8 @@
 
 DigitalOut myled(LED1);
 
+FastJpegCamera fast_jpeg_camera(p9, p10);
+
 int fileio() {
     mkdir("/sd/20014", 0777);
     
@@ -36,9 +39,9 @@
 
 
 int main() {
+    pc.printf("main() started. pc.baud is 9600 at this time.");
+    //pc.baud(9600);
     myled = 1;
-    
-    pc.baud(115200);
  
     int readings[3] = {0, 0, 0};
     
@@ -89,7 +92,7 @@
             (float((int16_t)readings[0]+18)/256), 
             (float((int16_t)readings[1]-4 )/256), 
             (float((int16_t)readings[2]+22)/256));
-        xbee.printf("  %+4.2f, %+4.2f, %+4.2f\n",
+        xbee.printf("X:%+4.2f Y:%+4.2f Z:%+4.2f ",
             (float((int16_t)readings[0]+18)/256), 
             (float((int16_t)readings[1]-4 )/256), 
             (float((int16_t)readings[2]+22)/256));
@@ -99,20 +102,22 @@
         //ADXL 345 Acceleration measurement
         pc.printf("\nBOSH BMP085 --------------------\n");
         pc.printf("  p:%6.2f hPa / t:%6.2f C\n", bmp085.get_pressure(), bmp085.get_temperature());
-        xbee.printf("  p:%6.2f hPa / t:%6.2f C\n", bmp085.get_pressure(), bmp085.get_temperature());
+        xbee.printf("P:%6.2f T:%6.2f ", bmp085.get_pressure(), bmp085.get_temperature());
         
         //CSDS Ambient light measurement P15 analog-in1
         pc.printf("Ambient light :: %f\n",ain_CDS*100);
-        xbee.printf("Ambient light :: %f\n",ain_CDS*100);
+        xbee.printf("L%f ",ain_CDS*100);
         
         //Humidity measurement P16 analog-in2
         pc.printf("Humidity       :: %f\n",ain_Humedity*100);
-        xbee.printf("Humidity       :: %f\n",ain_Humedity*100);
+        xbee.printf("H:%f ",ain_Humedity*100);
         
         //LM35DZ Temperature measurement P20 analog-in6
-        pc.printf("Temperature    :: %f\n",ain_LM35DZ*100);
+        //this sensor does not work for now. disabled.
+        //pc.printf("Temperature    :: %f\n",ain_LM35DZ*100);
         
         //take picture
-        main_camera(loop_count);
+        //main_camera(loop_count);
+        fast_jpeg_camera.shoot(loop_count);
     }
 }
\ No newline at end of file