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 Oct 22 07:14:50 2020 +0000
Parent:
27:06ec1277807c
Commit message:
fix if condition

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 06ec1277807c -r 5c82ee674ad9 main.cpp
--- a/main.cpp	Wed Jul 22 03:09:47 2020 +0000
+++ b/main.cpp	Thu Oct 22 07:14:50 2020 +0000
@@ -49,16 +49,19 @@
         eps.power_saving_mode(&flag,&btvol);
         sensor.temp_sense(&temp);
         gs.printf("HEPTASAT::Condition = %d, Time = %f [s], BatVol = %.2f [V],Temp = %.2f [C]\r\n",flag,sattime,btvol,temp);
+        
         //Condition
         cond[0] = 1;
+        
         //Warning the status of temperature and battery voltage
-        if(flag == 1) {
-            gs.printf("Low Battery\r\n");
+        if((flag == 1) & (temp > 35.0)) {
+            gs.printf("Low Battery and High temperature\n");
         } else if(temp > 35.0) {
             gs.printf("High temperature\r\n");
-        } else if((flag == 1) & (temp > 35.0)) {
-            gs.printf("Low Battery and High temperature\n");
+        } else if(flag == 1) {
+            gs.printf("Low Battery\r\n");
         }
+        
         //Contents of command
         if (cmdflag == 1) {
             if (rcmd == 'a') {