for textbook v4.4

Dependencies:   HEPTA_SENSOR mbed HEPTA_EPS HEPTA_COM HEPTA_CDH

Files at this revision

API Documentation at this revision

Comitter:
HeptaSatTraining2019
Date:
Thu Nov 12 06:41:42 2020 +0000
Commit message:
new one

Changed in this revision

HEPTA_CDH.lib Show annotated file Show diff for this revision Revisions of this file
HEPTA_COM.lib Show annotated file Show diff for this revision Revisions of this file
HEPTA_EPS.lib Show annotated file Show diff for this revision Revisions of this file
HEPTA_SENSOR.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HEPTA_CDH.lib	Thu Nov 12 06:41:42 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/HeptaSatTraining2019/code/HEPTA_CDH/#acea019126b1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HEPTA_COM.lib	Thu Nov 12 06:41:42 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/HeptaSatTraining2019/code/HEPTA_COM/#1838cbd7d223
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HEPTA_EPS.lib	Thu Nov 12 06:41:42 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/HeptaSatTraining2019/code/HEPTA_EPS/#4f08f55763c7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HEPTA_SENSOR.lib	Thu Nov 12 06:41:42 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/HeptaSatTraining2019/code/HEPTA_SENSOR/#f7912b7dcfc2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 12 06:41:42 2020 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+#include "HEPTA_EPS.h"
+#include "HEPTA_CDH.h"
+#include "HEPTA_SENSOR.h"
+#include "HEPTA_COM.h"
+
+Serial pc(USBTX,USBRX);
+HEPTA_EPS eps(p16,p26);
+HEPTA_CDH cdh(p5,p6,p7,p8,"sd");
+HEPTA_SENSOR sensor(p17, 
+                    p28,p27,0xD0,0x18,
+                    p13,p14,p25,p24);
+HEPTA_COM com(p9,p10);
+
+int main()
+{
+    pc.baud(9600);
+    int rcmd=0,cmdflag=0;
+    FILE *dummy = fopen("/sd/dummy.txt","w");
+    if(dummy == NULL) {
+        error("Could not open file for write\r\n");
+    }
+    fclose(dummy);
+    
+    while(1)
+    {
+        wait(0.2);
+        com.xbee_receive(&rcmd,&cmdflag);
+        pc.printf("rcmd=%d, cmdflag=%d\r\n",rcmd, cmdflag);
+        if (cmdflag == 1) {
+            pc.printf("Command Get %d\r\n",rcmd);
+            if(rcmd == 'a'){
+                com.printf("CAMERA\r\n");
+                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];
+                    com.printf("INICIO\r\n");
+                    while((fgets(str,256,fp))!=NULL) {
+                        com.printf("%s",str);
+                        wait(0.001);
+                    }
+                    com.printf("FIN\r\n");
+                    pc.printf("Data transmitting finished:)\r\n");
+                    fclose(fp);
+                }
+            }
+            com.initialize();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 12 06:41:42 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file