for_20211114
Dependencies: HEPTA_SENSOR mbed HEPTA_EPS HEPTA_COM HEPTA_CDH
Diff: main.cpp
- Revision:
- 28:80d6576011e1
- Parent:
- 27:ecdf196153cd
- Child:
- 29:3d7a0b3a1b8a
--- a/main.cpp Wed Jul 22 02:27:10 2020 +0000 +++ b/main.cpp Sun Nov 14 08:10:45 2021 +0000 @@ -5,6 +5,7 @@ Serial gs(USBTX,USBRX); // for ground station HEPTA_CDH cdh(p5, p6, p7, p8, "sd"); HEPTA_EPS eps(p16,p26); +Timer sattime; int rcmd = 0,cmdflag = 0; //command variable //getting command and flag @@ -30,14 +31,15 @@ gs.baud(9600); gs.printf("From Sat : Operation Start...\r\n"); int flag = 0; // condition - float sattime=0.0,btvol,temp; //Voltage, Temerature + float btvol,temp; //Voltage, Temerature + sattime.start(); receive(rcmd,cmdflag); //interupting by ground station command for(int i = 0; i < 100; i++) { //Sensing and Transmitting HK data eps.vol(&btvol); temp = 28.5; - gs.printf("HEPTASAT::Condition = %d, Time = %f [s], batVol = %.2f [V],Temp = %.2f [C]\r\n",flag,sattime,btvol,temp); + gs.printf("HEPTASAT::Condition = %d, Time = %f [s], batVol = %.2f [V],Temp = %.2f [C]\r\n",flag,sattime.read(),btvol,temp); //Condition cond[0] = 1; //Power Saving Mode @@ -63,10 +65,7 @@ } initialize(); } - - //Operation Interval - wait(1.0); - sattime = sattime+1.0; } + sattime.stop(); gs.printf("From Sat : Operation Stop...\r\n"); } \ No newline at end of file