20211204
Dependencies: mbed
main.cpp@0:ae41416442ac, 2021-12-04 (annotated)
- Committer:
- heptasat2021
- Date:
- Sat Dec 04 04:25:13 2021 +0000
- Revision:
- 0:ae41416442ac
Lab1_satcode_20211204
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
heptasat2021 | 0:ae41416442ac | 1 | #include "mbed.h" |
heptasat2021 | 0:ae41416442ac | 2 | DigitalOut condition(LED1); |
heptasat2021 | 0:ae41416442ac | 3 | Serial gs(USBTX,USBRX,9600); |
heptasat2021 | 0:ae41416442ac | 4 | Timer sattime; |
heptasat2021 | 0:ae41416442ac | 5 | int main() |
heptasat2021 | 0:ae41416442ac | 6 | { |
heptasat2021 | 0:ae41416442ac | 7 | gs.printf("From Sat : Nominal Operation\r\n"); |
heptasat2021 | 0:ae41416442ac | 8 | int flag = 0; //condition flag |
heptasat2021 | 0:ae41416442ac | 9 | float batvol, temp; //voltage, temperature |
heptasat2021 | 0:ae41416442ac | 10 | sattime.start(); |
heptasat2021 | 0:ae41416442ac | 11 | for(int i=0;i<50;i++){ |
heptasat2021 | 0:ae41416442ac | 12 | //satellite condition led |
heptasat2021 | 0:ae41416442ac | 13 | condition = !condition; |
heptasat2021 | 0:ae41416442ac | 14 | |
heptasat2021 | 0:ae41416442ac | 15 | //senssing HK data(dummy data) |
heptasat2021 | 0:ae41416442ac | 16 | batvol = 3.7; |
heptasat2021 | 0:ae41416442ac | 17 | temp = 28.5; |
heptasat2021 | 0:ae41416442ac | 18 | |
heptasat2021 | 0:ae41416442ac | 19 | //Transmitting HK data to Ground Station(GS) |
heptasat2021 | 0:ae41416442ac | 20 | gs.printf("HEPTASAT::Condition = %d, Time = %f [s], batvol = %2f [V], temp = %2f [deg C]\r\n",flag,sattime.read(),batvol,temp); |
heptasat2021 | 0:ae41416442ac | 21 | wait_ms(1000); |
heptasat2021 | 0:ae41416442ac | 22 | } |
heptasat2021 | 0:ae41416442ac | 23 | sattime.stop(); |
heptasat2021 | 0:ae41416442ac | 24 | gs.printf("From Sat : End of operation\r\n"); |
heptasat2021 | 0:ae41416442ac | 25 | } |