Appendix

Dependencies:   HEPTA_SENSOR mbed HEPTA_EPS HEPTA_COM HEPTA_CDH

Files at this revision

API Documentation at this revision

Comitter:
HeptaSatTraining2019
Date:
Tue Aug 27 03:52:39 2019 +0000
Parent:
25:5fd40a170032
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5fd40a170032 -r 244a1b28d88b main.cpp
--- a/main.cpp	Tue Aug 27 01:15:05 2019 +0000
+++ b/main.cpp	Tue Aug 27 03:52:39 2019 +0000
@@ -7,17 +7,31 @@
 Serial pc(USBTX,USBRX);
 HEPTA_EPS eps(p16,p26);
 HEPTA_CDH cdh(p5,p6,p7,p8,"sd");
-HEPTA_SENSOR sensor(p17, 
+HEPTA_SENSOR sensor(p17,
                     p28,p27,0xD0,0x18,
                     p13,p14,p25,p24);
 HEPTA_COM com(p9,p10);
 
-DigitalOut myled(LED1);
-
 int main()
 {
-    myled = 1;
-    wait(0.5);
-    myled = 0;
-    wait(0.5);
+    FILE *dummy = fopen("/sd/dummy.txt","w");
+    fclose(dummy);
+    pc.printf("Camera Snapshot Mode\r\n");
+    pc.printf("Hit Any Key To Take Picture\r\n");
+    while(!pc.readable()) {}
+    sensor.Sync();
+    sensor.initialize(HeptaCamera_GPS::Baud115200, HeptaCamera_GPS::JpegResolution320x240);
+    sensor.test_jpeg_snapshot_data("/sd/test.txt");
+    FILE *fp = fopen("/sd/test.txt", "r");
+    if(fp == NULL) {
+        pc.printf("Could not open file for write\r\n");
+    } else {
+        char str[1024];
+        while((fgets(str,256,fp))!=NULL) {
+            pc.printf("%s",str);
+            //com.printf("%s",str);
+            wait(0.001);
+        }
+        fclose(fp);
+    }
 }
\ No newline at end of file