Lab5-01_uplink_ok_lite
Dependencies: mbed HEPTA_COM_lite
main.cpp@2:8757050cdfa8, 2021-08-20 (annotated)
- Committer:
- heptasat2021
- Date:
- Fri Aug 20 13:41:31 2021 +0000
- Revision:
- 2:8757050cdfa8
- Parent:
- 1:ddac5ec89167
For Hepta-Sat Lite
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
heptasat2021 | 0:da0f6aca15b8 | 1 | #include "mbed.h" |
heptasat2021 | 2:8757050cdfa8 | 2 | #include "HEPTA_COM.h" |
heptasat2021 | 2:8757050cdfa8 | 3 | HEPTA_COM com(PA_9,PA_10,9600); |
heptasat2021 | 2:8757050cdfa8 | 4 | Serial sat(USBTX,USBRX,9600); |
heptasat2021 | 0:da0f6aca15b8 | 5 | int main() |
heptasat2021 | 0:da0f6aca15b8 | 6 | { |
heptasat2021 | 2:8757050cdfa8 | 7 | sat.printf("Xbee Uplink Ok Mode\r\n"); |
heptasat2021 | 2:8757050cdfa8 | 8 | int rcmd=0,cmdflag=0; |
heptasat2021 | 2:8757050cdfa8 | 9 | for(int i=0;i<10;i++){ |
heptasat2021 | 2:8757050cdfa8 | 10 | com.xbee_receive(&rcmd,&cmdflag); |
heptasat2021 | 2:8757050cdfa8 | 11 | com.printf("num=%d\r\n",i); |
heptasat2021 | 2:8757050cdfa8 | 12 | if(cmdflag==1){ |
heptasat2021 | 2:8757050cdfa8 | 13 | if(rcmd=='a'){ |
heptasat2021 | 2:8757050cdfa8 | 14 | sat.printf("rcmd=%c,cmdflag=%d\r\n",rcmd,cmdflag); |
heptasat2021 | 2:8757050cdfa8 | 15 | com.printf("Hepta-Sat Lite Uplink Ok\r\n"); |
heptasat2021 | 2:8757050cdfa8 | 16 | } |
heptasat2021 | 2:8757050cdfa8 | 17 | com.initialize(); |
heptasat2021 | 2:8757050cdfa8 | 18 | } |
heptasat2021 | 2:8757050cdfa8 | 19 | wait_ms(1000); |
heptasat2021 | 0:da0f6aca15b8 | 20 | } |
heptasat2021 | 0:da0f6aca15b8 | 21 | } |